@@ -1378,12 +1378,14 @@ def outer_type_or_annotation(field: FieldInfo):
1378
1378
def should_index_field (field_info : Union [FieldInfo , PydanticFieldInfo ]) -> bool :
1379
1379
# for vector, full text search, and sortable fields, we always have to index
1380
1380
# We could require the user to set index=True, but that would be a breaking change
1381
- index = getattr (field_info , "index" , None ) is True
1381
+ _index = getattr (field_info , "index" , None )
1382
+
1383
+ index = _index is True
1382
1384
vector_options = getattr (field_info , "vector_options" , None ) is not None
1383
1385
full_text_search = getattr (field_info , "full_text_search" , None ) is True
1384
1386
sortable = getattr (field_info , "sortable" , None ) is True
1385
1387
1386
- if index is False and any ([vector_options , full_text_search , sortable ]):
1388
+ if _index is False and any ([vector_options , full_text_search , sortable ]):
1387
1389
log .warning (
1388
1390
"Field is marked as index=False, but it is a vector, full text search, or sortable field. "
1389
1391
"This will be ignored and the field will be indexed." ,
@@ -1965,7 +1967,7 @@ def schema_for_type(
1965
1967
json_path : str ,
1966
1968
name : str ,
1967
1969
name_prefix : str ,
1968
- typ : Union [type [RedisModel ], Any ],
1970
+ typ : Union [Type [RedisModel ], Any ],
1969
1971
field_info : PydanticFieldInfo ,
1970
1972
parent_type : Optional [Any ] = None ,
1971
1973
) -> str :
0 commit comments