|
30 | 30 | from pydantic._internal._model_construction import ModelMetaclass |
31 | 31 | from pydantic._internal._repr import Representation |
32 | 32 | from pydantic.fields import FieldInfo as PydanticFieldInfo |
33 | | -from pydantic.fields import _FieldInfoInputs |
| 33 | +from pydantic.fields import _FromFieldInfoInputs |
34 | 34 | from pydantic_core import PydanticUndefined as Undefined |
35 | 35 | from pydantic_core import PydanticUndefinedType as UndefinedType |
36 | 36 | from redis.commands.json.path import Path |
@@ -1184,7 +1184,7 @@ def Field( |
1184 | 1184 | index: Union[bool, UndefinedType] = Undefined, |
1185 | 1185 | full_text_search: Union[bool, UndefinedType] = Undefined, |
1186 | 1186 | vector_options: Optional[VectorFieldOptions] = None, |
1187 | | - **kwargs: Unpack[_FieldInfoInputs], |
| 1187 | + **kwargs: Unpack[_FromFieldInfoInputs], |
1188 | 1188 | ) -> Any: |
1189 | 1189 | field_info = FieldInfo( |
1190 | 1190 | **kwargs, |
@@ -1375,7 +1375,7 @@ def outer_type_or_annotation(field: FieldInfo): |
1375 | 1375 | return field.annotation.__args__[0] # type: ignore |
1376 | 1376 |
|
1377 | 1377 |
|
1378 | | -def should_index_field(field_info: FieldInfo) -> bool: |
| 1378 | +def should_index_field(field_info: 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 | 1381 | index = getattr(field_info, "index", None) is True |
|
0 commit comments