Skip to content

Commit 6f31a67

Browse files
groksrcclaude
andcommitted
test(core): drop empty metadata dict from after_date regression
SearchIndexRow.to_insert only JSON-serializes truthy metadata (`if serialize_json and self.metadata`), so passing `metadata={}` sent a raw dict into the SQLite parameter binding and tripped a ProgrammingError before the assertions ever ran. Letting metadata default to None lets the test exercise the after_date / ORDER BY fix it was written for. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> Signed-off-by: Drew Cain <groksrc@gmail.com>
1 parent 15992d2 commit 6f31a67

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

tests/services/test_search_service.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,9 @@ async def test_after_date_uses_updated_at(search_service):
208208

209209
project_id = search_service.repository.project_id
210210

211+
# Leave metadata at its None default — SearchIndexRow.to_insert only
212+
# JSON-serializes truthy metadata, so passing {} would slip an
213+
# un-serialized dict into the SQLite bind and raise ProgrammingError.
211214
recently_updated_row = SearchIndexRow(
212215
project_id=project_id,
213216
id=99001,
@@ -218,7 +221,6 @@ async def test_after_date_uses_updated_at(search_service):
218221
permalink="test/recently-updated-entity",
219222
created_at=old_created,
220223
updated_at=recently_updated,
221-
metadata={},
222224
)
223225
stale_row = SearchIndexRow(
224226
project_id=project_id,
@@ -230,7 +232,6 @@ async def test_after_date_uses_updated_at(search_service):
230232
permalink="test/stale-entity",
231233
created_at=old_created,
232234
updated_at=stale_updated,
233-
metadata={},
234235
)
235236

236237
await search_service.repository.index_item(recently_updated_row)

0 commit comments

Comments
 (0)