diff --git a/generators/python/core_utilities/shared/with_pydantic_v1_on_v2/pydantic_utilities.py b/generators/python/core_utilities/shared/with_pydantic_v1_on_v2/pydantic_utilities.py index c879bfff336..a34f7084a69 100644 --- a/generators/python/core_utilities/shared/with_pydantic_v1_on_v2/pydantic_utilities.py +++ b/generators/python/core_utilities/shared/with_pydantic_v1_on_v2/pydantic_utilities.py @@ -37,7 +37,7 @@ def parse_obj_as(type_: typing.Type[T], object_: typing.Any) -> T: dealiased_object = convert_and_respect_annotation_metadata(object_=object_, annotation=type_, direction="read") - return pydantic.parse_obj_as(type_, dealiased_object) + return pydantic.v1.parse_obj_as(type_, dealiased_object) def to_jsonable_with_fallback( @@ -173,14 +173,14 @@ def universal_root_validator( pre: bool = False, ) -> typing.Callable[[AnyCallable], AnyCallable]: def decorator(func: AnyCallable) -> AnyCallable: - return pydantic.root_validator(pre=pre)(func) # type: ignore # Pydantic v1 + return pydantic.v1.root_validator(pre=pre)(func) # type: ignore # Pydantic v1 return decorator def universal_field_validator(field_name: str, pre: bool = False) -> typing.Callable[[AnyCallable], AnyCallable]: def decorator(func: AnyCallable) -> AnyCallable: - return pydantic.validator(field_name, pre=pre)(func) # type: ignore # Pydantic v1 + return pydantic.v1.validator(field_name, pre=pre)(func) # type: ignore # Pydantic v1 return decorator