|
22 | 22 | TypeVar,
|
23 | 23 | Union,
|
24 | 24 | )
|
25 |
| -from typing import get_args as typing_get_args |
26 |
| -from typing import no_type_check |
| 25 | +from typing import get_args as typing_get_args, no_type_check |
27 | 26 |
|
28 | 27 | from more_itertools import ichunked
|
29 | 28 | from redis.commands.json.path import Path
|
@@ -1203,7 +1202,6 @@ def Field(
|
1203 | 1202 | vector_options=vector_options,
|
1204 | 1203 | **current_schema_extra,
|
1205 | 1204 | )
|
1206 |
| - # field_info._validate() |
1207 | 1205 | return field_info
|
1208 | 1206 |
|
1209 | 1207 |
|
@@ -1300,7 +1298,6 @@ def __new__(cls, name, bases, attrs, **kwargs): # noqa C901
|
1300 | 1298 | else:
|
1301 | 1299 | new_class.__annotations__[field_name] = ExpressionProxy
|
1302 | 1300 | # Check if this is our FieldInfo version with extended ORM metadata.
|
1303 |
| - # if isinstance(field.field_info, FieldInfo): |
1304 | 1301 | field_info = None
|
1305 | 1302 | if hasattr(field, "field_info") and isinstance(field.field_info, FieldInfo):
|
1306 | 1303 | field_info = field.field_info
|
@@ -1371,9 +1368,7 @@ def outer_type_or_annotation(field):
|
1371 | 1368 |
|
1372 | 1369 |
|
1373 | 1370 | class RedisModel(BaseModel, abc.ABC, metaclass=ModelMeta):
|
1374 |
| - # class RedisModel(BaseModel, abc.ABC): |
1375 | 1371 | pk: Optional[str] = Field(default=None, primary_key=True)
|
1376 |
| - # pk: Optional[str] = Field(default=None, primary_key=True) |
1377 | 1372 |
|
1378 | 1373 | Meta = DefaultMeta
|
1379 | 1374 |
|
@@ -1646,11 +1641,6 @@ async def save(
|
1646 | 1641 | ) -> "Model":
|
1647 | 1642 | self.check()
|
1648 | 1643 | db = self._get_db(pipeline)
|
1649 |
| - |
1650 |
| - # if hasattr(self,'model_fields_set'): |
1651 |
| - # dict = {k: v for k, v in self.dict().items() if k in self.model_fields_set} |
1652 |
| - # else: |
1653 |
| - # dict = self.dict() |
1654 | 1644 | document = jsonable_encoder(self.dict())
|
1655 | 1645 | # TODO: Wrap any Redis response errors in a custom exception?
|
1656 | 1646 | await db.hset(self.key(), mapping=document)
|
|
0 commit comments