Skip to content

Commit d5520ed

Browse files
committed
fix linting errors
1 parent 48a092b commit d5520ed

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

aredis_om/model/model.py

+6-4
Original file line numberDiff line numberDiff line change
@@ -1371,16 +1371,18 @@ def outer_type_or_annotation(field: FieldInfo):
13711371
else:
13721372
return field.annotation.__args__[0] # type: ignore
13731373

1374-
def should_index_field(field_info: FieldInfo) -> bool:
1374+
1375+
def should_index_field(field_info: PydanticFieldInfo) -> bool:
13751376
# for vector, full text search, and sortable fields, we always have to index
13761377
# We could require the user to set index=True, but that would be a breaking change
13771378
return (
13781379
getattr(field_info, "index", False) is True
1379-
or getattr(field_info, "vector_options", None) is not None
1380-
or getattr(field_info, "full_text_search", False) is True
1381-
or getattr(field_info, "sortable", False) is True
1380+
or getattr(field_info, "vector_options", None) is not None
1381+
or getattr(field_info, "full_text_search", False) is True
1382+
or getattr(field_info, "sortable", False) is True
13821383
)
13831384

1385+
13841386
class RedisModel(BaseModel, abc.ABC, metaclass=ModelMeta):
13851387
pk: Optional[str] = Field(
13861388
# Indexing for backwards compatibility, we might not want this in the future

tests/test_json_model.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1329,7 +1329,7 @@ class Child(Model):
13291329
pass
13301330

13311331
assert issubclass(Child, Model)
1332-
1332+
13331333
child = Child(name="John")
13341334

13351335
assert child.name == "John"

0 commit comments

Comments
 (0)