From 245539469538150098a1a0b8072a767fad05b3c9 Mon Sep 17 00:00:00 2001 From: Steve Lorello <42971704+slorello89@users.noreply.github.com> Date: Wed, 30 Oct 2024 09:48:30 -0400 Subject: [PATCH] fixing broken Pydantic v1 regression (#663) * fixing broken Pydantic v1 regression * mypy thing --- aredis_om/model/encoders.py | 2 +- aredis_om/model/model.py | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/aredis_om/model/encoders.py b/aredis_om/model/encoders.py index 93142f4..cb71447 100644 --- a/aredis_om/model/encoders.py +++ b/aredis_om/model/encoders.py @@ -90,7 +90,7 @@ def jsonable_encoder( sqlalchemy_safe=sqlalchemy_safe, ) if dataclasses.is_dataclass(obj): - return dataclasses.asdict(obj) # type: ignore[call-overload] + return dataclasses.asdict(obj) # type: ignore if isinstance(obj, Enum): return obj.value if isinstance(obj, PurePath): diff --git a/aredis_om/model/model.py b/aredis_om/model/model.py index 27ebcc5..d283b29 100644 --- a/aredis_om/model/model.py +++ b/aredis_om/model/model.py @@ -1432,7 +1432,8 @@ def outer_type_or_annotation(field): class RedisModel(BaseModel, abc.ABC, metaclass=ModelMeta): pk: Optional[str] = Field(default=None, primary_key=True) - ConfigDict: ClassVar + if PYDANTIC_V2: + ConfigDict: ClassVar Meta = DefaultMeta