Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Tests

on:
push:
branches: [main]
pull_request:
branches: [main]

jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.10", "3.11", "3.12"]

steps:
- uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -e ".[dev]"

- name: Run linter
run: make lint

- name: Run tests
run: pytest
6 changes: 3 additions & 3 deletions src/jsonldb/database.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,10 @@ def _get_from_wal(self, record_id: str) -> Record | None:
for entry in self.wal.scan():
if entry.record_id == record_id:
last_entry = entry

if last_entry is None:
return None

if last_entry.op == "delete":
return None
if last_entry.op in ("insert", "update") and last_entry.data:
Expand Down Expand Up @@ -141,7 +141,7 @@ def count(self) -> int:

def compact(self) -> int:
compacted_records = {}

for record in self._scan_data():
compacted_records[record.id] = record

Expand Down