From 017e1689a5674ce81684bc34676f0bd0ebb01964 Mon Sep 17 00:00:00 2001 From: jameschua Date: Sat, 20 May 2023 18:46:45 +0100 Subject: [PATCH] revert --- strawberry/experimental/pydantic/conversion.py | 1 + strawberry/experimental/pydantic/error_type.py | 3 +-- strawberry/experimental/pydantic/fields.py | 11 ++++------- strawberry/experimental/pydantic/utils.py | 1 + 4 files changed, 7 insertions(+), 9 deletions(-) diff --git a/strawberry/experimental/pydantic/conversion.py b/strawberry/experimental/pydantic/conversion.py index e138e1e807..bc0f787948 100644 --- a/strawberry/experimental/pydantic/conversion.py +++ b/strawberry/experimental/pydantic/conversion.py @@ -9,6 +9,7 @@ from strawberry.union import StrawberryUnion if TYPE_CHECKING: + from strawberry.field import StrawberryField from strawberry.type import StrawberryType diff --git a/strawberry/experimental/pydantic/error_type.py b/strawberry/experimental/pydantic/error_type.py index f6a2d380ec..adcdd5cdf4 100644 --- a/strawberry/experimental/pydantic/error_type.py +++ b/strawberry/experimental/pydantic/error_type.py @@ -16,6 +16,7 @@ ) from pydantic import BaseModel +from pydantic.utils import lenient_issubclass from strawberry.auto import StrawberryAuto from strawberry.experimental.pydantic.utils import ( @@ -23,12 +24,10 @@ get_strawberry_type_from_model, normalize_type, ) -from strawberry.experimental.pydantic.v2_compat import lenient_issubclass from strawberry.object_type import _process_type, _wrap_dataclass from strawberry.types.type_resolver import _get_fields from strawberry.utils.typing import get_list_annotation, is_list - from .exceptions import MissingFieldsListError if TYPE_CHECKING: diff --git a/strawberry/experimental/pydantic/fields.py b/strawberry/experimental/pydantic/fields.py index ebcfe6dd34..cfa3a6be2c 100644 --- a/strawberry/experimental/pydantic/fields.py +++ b/strawberry/experimental/pydantic/fields.py @@ -5,13 +5,9 @@ import pydantic from pydantic import BaseModel -from strawberry.experimental.pydantic.v2_compat import ( - lenient_issubclass, - get_args, - get_origin, - is_new_type, - new_type_supertype, -) +from pydantic.typing import get_args, get_origin, is_new_type, new_type_supertype +from pydantic.utils import lenient_issubclass + from strawberry.experimental.pydantic.exceptions import ( UnregisteredTypeException, UnsupportedTypeError, @@ -74,6 +70,7 @@ "RedisDsn": str, } + FIELDS_MAP = { getattr(pydantic, field_name): type for field_name, type in ATTR_TO_TYPE_MAP.items() diff --git a/strawberry/experimental/pydantic/utils.py b/strawberry/experimental/pydantic/utils.py index 00a966f2ed..e863a47e16 100644 --- a/strawberry/experimental/pydantic/utils.py +++ b/strawberry/experimental/pydantic/utils.py @@ -14,6 +14,7 @@ cast, ) +from pydantic.utils import smart_deepcopy from strawberry.experimental.pydantic.exceptions import ( AutoFieldsNotInBaseModelError,