Skip to content

Commit

Permalink
addressing comments
Browse files Browse the repository at this point in the history
  • Loading branch information
slorello89 committed Apr 24, 2024
1 parent 37bf652 commit 31d99ac
Showing 1 changed file with 1 addition and 11 deletions.
12 changes: 1 addition & 11 deletions aredis_om/model/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@
TypeVar,
Union,
)
from typing import get_args as typing_get_args
from typing import no_type_check
from typing import get_args as typing_get_args, no_type_check

from more_itertools import ichunked
from redis.commands.json.path import Path
Expand Down Expand Up @@ -1203,7 +1202,6 @@ def Field(
vector_options=vector_options,
**current_schema_extra,
)
# field_info._validate()
return field_info


Expand Down Expand Up @@ -1300,7 +1298,6 @@ def __new__(cls, name, bases, attrs, **kwargs): # noqa C901
else:
new_class.__annotations__[field_name] = ExpressionProxy
# Check if this is our FieldInfo version with extended ORM metadata.
# if isinstance(field.field_info, FieldInfo):
field_info = None
if hasattr(field, "field_info") and isinstance(field.field_info, FieldInfo):
field_info = field.field_info
Expand Down Expand Up @@ -1371,9 +1368,7 @@ def outer_type_or_annotation(field):


class RedisModel(BaseModel, abc.ABC, metaclass=ModelMeta):
# class RedisModel(BaseModel, abc.ABC):
pk: Optional[str] = Field(default=None, primary_key=True)
# pk: Optional[str] = Field(default=None, primary_key=True)

Meta = DefaultMeta

Expand Down Expand Up @@ -1646,11 +1641,6 @@ async def save(
) -> "Model":
self.check()
db = self._get_db(pipeline)

# if hasattr(self,'model_fields_set'):
# dict = {k: v for k, v in self.dict().items() if k in self.model_fields_set}
# else:
# dict = self.dict()
document = jsonable_encoder(self.dict())
# TODO: Wrap any Redis response errors in a custom exception?
await db.hset(self.key(), mapping=document)
Expand Down

0 comments on commit 31d99ac

Please sign in to comment.