Skip to content

Commit

Permalink
fix type annotation for 2.8.2
Browse files Browse the repository at this point in the history
create_schema_validator now returns SchemaValidator | PluggableSchemaValidator
  • Loading branch information
camillol committed Aug 27, 2024
1 parent c60fa0f commit 44f9c3b
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions ormar/models/mixins/save_mixin.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,10 @@
cast,
)

from pydantic.plugin._schema_validator import create_schema_validator
from pydantic.plugin._schema_validator import (
PluggableSchemaValidator,
create_schema_validator,
)
from pydantic_core import CoreSchema, SchemaValidator

import ormar # noqa: I100, I202
Expand All @@ -36,7 +39,9 @@ class SavePrepareMixin(RelationMixin, AliasMixin):
_json_fields: Set[str]
_bytes_fields: Set[str]
__pydantic_core_schema__: CoreSchema
__ormar_fields_validators__: Optional[Dict[str, SchemaValidator]]
__ormar_fields_validators__: Optional[
Dict[str, SchemaValidator | PluggableSchemaValidator]
]

@classmethod
def prepare_model_to_save(cls, new_kwargs: dict) -> dict:
Expand Down

0 comments on commit 44f9c3b

Please sign in to comment.