Skip to content

Commit

Permalink
Adjust item_class so tests/linting can pass using new pydantic version (
Browse files Browse the repository at this point in the history
  • Loading branch information
Winston-Hsiao authored Nov 21, 2024
1 parent cac27e1 commit 7903b49
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion store/app/crud/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,7 @@ async def _get_unique_item_from_secondary_index(
item_class: type[T],
throw_if_missing: bool = False,
) -> T | None:
if secondary_index_name not in item_class.model_fields:
if secondary_index_name not in item_class.model_json_schema()["properties"]:
raise InternalError(f"Field '{secondary_index_name}' not in model {item_class.__name__}")
items = await self._get_items_from_secondary_index(
secondary_index_name,
Expand Down

0 comments on commit 7903b49

Please sign in to comment.