@@ -1378,12 +1378,14 @@ def outer_type_or_annotation(field: FieldInfo):
13781378def should_index_field (field_info : Union [FieldInfo , PydanticFieldInfo ]) -> bool :
13791379 # for vector, full text search, and sortable fields, we always have to index
13801380 # 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
13821384 vector_options = getattr (field_info , "vector_options" , None ) is not None
13831385 full_text_search = getattr (field_info , "full_text_search" , None ) is True
13841386 sortable = getattr (field_info , "sortable" , None ) is True
13851387
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 ]):
13871389 log .warning (
13881390 "Field is marked as index=False, but it is a vector, full text search, or sortable field. "
13891391 "This will be ignored and the field will be indexed." ,
@@ -1965,7 +1967,7 @@ def schema_for_type(
19651967 json_path : str ,
19661968 name : str ,
19671969 name_prefix : str ,
1968- typ : Union [type [RedisModel ], Any ],
1970+ typ : Union [Type [RedisModel ], Any ],
19691971 field_info : PydanticFieldInfo ,
19701972 parent_type : Optional [Any ] = None ,
19711973 ) -> str :
0 commit comments