From 4ca737dfefe9d37bb058177dc16e736200c28557 Mon Sep 17 00:00:00 2001 From: Christoph Kappestein Date: Sun, 10 Nov 2024 20:05:26 +0100 Subject: [PATCH] fix import --- src/Generator/Python.php | 8 +++++++- .../resource/python/complex/any_property_type.py | 2 +- tests/Generator/resource/python/complex/argument.py | 2 +- .../resource/python/complex/array_definition_type.py | 2 +- .../resource/python/complex/array_property_type.py | 2 +- .../resource/python/complex/boolean_property_type.py | 2 +- .../resource/python/complex/collection_definition_type.py | 2 +- .../resource/python/complex/collection_property_type.py | 2 +- .../Generator/resource/python/complex/definition_type.py | 2 +- .../resource/python/complex/generic_property_type.py | 2 +- .../resource/python/complex/integer_property_type.py | 2 +- .../resource/python/complex/map_definition_type.py | 2 +- .../resource/python/complex/map_property_type.py | 2 +- .../resource/python/complex/number_property_type.py | 2 +- tests/Generator/resource/python/complex/operation.py | 2 +- tests/Generator/resource/python/complex/property_type.py | 2 +- .../resource/python/complex/reference_property_type.py | 2 +- tests/Generator/resource/python/complex/response.py | 2 +- .../resource/python/complex/scalar_property_type.py | 2 +- tests/Generator/resource/python/complex/security.py | 2 +- .../Generator/resource/python/complex/security_api_key.py | 2 +- .../resource/python/complex/security_http_basic.py | 2 +- .../resource/python/complex/security_http_bearer.py | 2 +- .../Generator/resource/python/complex/security_o_auth.py | 2 +- .../resource/python/complex/string_property_type.py | 2 +- .../resource/python/complex/struct_definition_type.py | 2 +- tests/Generator/resource/python/complex/type_api.py | 2 +- tests/Generator/resource/python/complex/type_schema.py | 2 +- tests/Generator/resource/python/default/author.py | 2 +- tests/Generator/resource/python/default/location.py | 2 +- tests/Generator/resource/python/default/meta.py | 3 ++- tests/Generator/resource/python/default/news.py | 2 +- tests/Generator/resource/python/import/import.py | 2 +- tests/Generator/resource/python/import/my_map.py | 2 +- tests/Generator/resource/python/namespace/import.py | 2 +- tests/Generator/resource/python/namespace/my_map.py | 2 +- tests/Generator/resource/python/oop/human_map.py | 2 +- tests/Generator/resource/python/oop/human_type.py | 2 +- tests/Generator/resource/python/oop/map.py | 2 +- tests/Generator/resource/python/oop/root_schema.py | 2 +- tests/Generator/resource/python/oop/student.py | 2 +- tests/Generator/resource/python/oop/student_map.py | 2 +- 42 files changed, 49 insertions(+), 42 deletions(-) diff --git a/src/Generator/Python.php b/src/Generator/Python.php index a2b5d9f..9ac64c2 100644 --- a/src/Generator/Python.php +++ b/src/Generator/Python.php @@ -149,7 +149,13 @@ private function getImports(DefinitionTypeAbstract $origin): array $imports[] = 'from pydantic import BaseModel, Field, GetCoreSchemaHandler'; $imports[] = 'from pydantic_core import CoreSchema, core_schema'; - $imports[] = 'from typing import Any, Dict, Generic, List, Optional, TypeVar, UserList, UserDict'; + $imports[] = 'from typing import Any, Dict, Generic, List, Optional, TypeVar'; + + if ($origin instanceof MapDefinitionType) { + $imports[] = 'from collections import UserDict'; + } elseif ($origin instanceof ArrayDefinitionType) { + $imports[] = 'from collections import UserList'; + } if (TypeUtil::contains($origin, StringPropertyType::class, Format::DATE)) { $imports[] = 'import datetime'; diff --git a/tests/Generator/resource/python/complex/any_property_type.py b/tests/Generator/resource/python/complex/any_property_type.py index e43eae2..03e416b 100644 --- a/tests/Generator/resource/python/complex/any_property_type.py +++ b/tests/Generator/resource/python/complex/any_property_type.py @@ -1,6 +1,6 @@ from pydantic import BaseModel, Field, GetCoreSchemaHandler from pydantic_core import CoreSchema, core_schema -from typing import Any, Dict, Generic, List, Optional, TypeVar, UserList, UserDict +from typing import Any, Dict, Generic, List, Optional, TypeVar from .property_type import PropertyType diff --git a/tests/Generator/resource/python/complex/argument.py b/tests/Generator/resource/python/complex/argument.py index 5c52455..dca68e5 100644 --- a/tests/Generator/resource/python/complex/argument.py +++ b/tests/Generator/resource/python/complex/argument.py @@ -1,6 +1,6 @@ from pydantic import BaseModel, Field, GetCoreSchemaHandler from pydantic_core import CoreSchema, core_schema -from typing import Any, Dict, Generic, List, Optional, TypeVar, UserList, UserDict +from typing import Any, Dict, Generic, List, Optional, TypeVar from .property_type import PropertyType from .string_property_type import StringPropertyType from .integer_property_type import IntegerPropertyType diff --git a/tests/Generator/resource/python/complex/array_definition_type.py b/tests/Generator/resource/python/complex/array_definition_type.py index ee456fc..3def80f 100644 --- a/tests/Generator/resource/python/complex/array_definition_type.py +++ b/tests/Generator/resource/python/complex/array_definition_type.py @@ -1,6 +1,6 @@ from pydantic import BaseModel, Field, GetCoreSchemaHandler from pydantic_core import CoreSchema, core_schema -from typing import Any, Dict, Generic, List, Optional, TypeVar, UserList, UserDict +from typing import Any, Dict, Generic, List, Optional, TypeVar from .collection_definition_type import CollectionDefinitionType diff --git a/tests/Generator/resource/python/complex/array_property_type.py b/tests/Generator/resource/python/complex/array_property_type.py index 986859f..6d96d55 100644 --- a/tests/Generator/resource/python/complex/array_property_type.py +++ b/tests/Generator/resource/python/complex/array_property_type.py @@ -1,6 +1,6 @@ from pydantic import BaseModel, Field, GetCoreSchemaHandler from pydantic_core import CoreSchema, core_schema -from typing import Any, Dict, Generic, List, Optional, TypeVar, UserList, UserDict +from typing import Any, Dict, Generic, List, Optional, TypeVar from .collection_property_type import CollectionPropertyType diff --git a/tests/Generator/resource/python/complex/boolean_property_type.py b/tests/Generator/resource/python/complex/boolean_property_type.py index b1084f6..c8450a5 100644 --- a/tests/Generator/resource/python/complex/boolean_property_type.py +++ b/tests/Generator/resource/python/complex/boolean_property_type.py @@ -1,6 +1,6 @@ from pydantic import BaseModel, Field, GetCoreSchemaHandler from pydantic_core import CoreSchema, core_schema -from typing import Any, Dict, Generic, List, Optional, TypeVar, UserList, UserDict +from typing import Any, Dict, Generic, List, Optional, TypeVar from .scalar_property_type import ScalarPropertyType diff --git a/tests/Generator/resource/python/complex/collection_definition_type.py b/tests/Generator/resource/python/complex/collection_definition_type.py index 463dbe5..00e80c7 100644 --- a/tests/Generator/resource/python/complex/collection_definition_type.py +++ b/tests/Generator/resource/python/complex/collection_definition_type.py @@ -1,6 +1,6 @@ from pydantic import BaseModel, Field, GetCoreSchemaHandler from pydantic_core import CoreSchema, core_schema -from typing import Any, Dict, Generic, List, Optional, TypeVar, UserList, UserDict +from typing import Any, Dict, Generic, List, Optional, TypeVar from .map_definition_type import MapDefinitionType from .array_definition_type import ArrayDefinitionType from .definition_type import DefinitionType diff --git a/tests/Generator/resource/python/complex/collection_property_type.py b/tests/Generator/resource/python/complex/collection_property_type.py index 1467b80..5ddb1ea 100644 --- a/tests/Generator/resource/python/complex/collection_property_type.py +++ b/tests/Generator/resource/python/complex/collection_property_type.py @@ -1,6 +1,6 @@ from pydantic import BaseModel, Field, GetCoreSchemaHandler from pydantic_core import CoreSchema, core_schema -from typing import Any, Dict, Generic, List, Optional, TypeVar, UserList, UserDict +from typing import Any, Dict, Generic, List, Optional, TypeVar from .property_type import PropertyType from .string_property_type import StringPropertyType from .integer_property_type import IntegerPropertyType diff --git a/tests/Generator/resource/python/complex/definition_type.py b/tests/Generator/resource/python/complex/definition_type.py index 8e14254..bf077a3 100644 --- a/tests/Generator/resource/python/complex/definition_type.py +++ b/tests/Generator/resource/python/complex/definition_type.py @@ -1,6 +1,6 @@ from pydantic import BaseModel, Field, GetCoreSchemaHandler from pydantic_core import CoreSchema, core_schema -from typing import Any, Dict, Generic, List, Optional, TypeVar, UserList, UserDict +from typing import Any, Dict, Generic, List, Optional, TypeVar from .struct_definition_type import StructDefinitionType from .map_definition_type import MapDefinitionType from .array_definition_type import ArrayDefinitionType diff --git a/tests/Generator/resource/python/complex/generic_property_type.py b/tests/Generator/resource/python/complex/generic_property_type.py index 7bb7c8e..640faae 100644 --- a/tests/Generator/resource/python/complex/generic_property_type.py +++ b/tests/Generator/resource/python/complex/generic_property_type.py @@ -1,6 +1,6 @@ from pydantic import BaseModel, Field, GetCoreSchemaHandler from pydantic_core import CoreSchema, core_schema -from typing import Any, Dict, Generic, List, Optional, TypeVar, UserList, UserDict +from typing import Any, Dict, Generic, List, Optional, TypeVar from .property_type import PropertyType diff --git a/tests/Generator/resource/python/complex/integer_property_type.py b/tests/Generator/resource/python/complex/integer_property_type.py index 312cdd4..95a4dcc 100644 --- a/tests/Generator/resource/python/complex/integer_property_type.py +++ b/tests/Generator/resource/python/complex/integer_property_type.py @@ -1,6 +1,6 @@ from pydantic import BaseModel, Field, GetCoreSchemaHandler from pydantic_core import CoreSchema, core_schema -from typing import Any, Dict, Generic, List, Optional, TypeVar, UserList, UserDict +from typing import Any, Dict, Generic, List, Optional, TypeVar from .scalar_property_type import ScalarPropertyType diff --git a/tests/Generator/resource/python/complex/map_definition_type.py b/tests/Generator/resource/python/complex/map_definition_type.py index 98822fd..27ad2b8 100644 --- a/tests/Generator/resource/python/complex/map_definition_type.py +++ b/tests/Generator/resource/python/complex/map_definition_type.py @@ -1,6 +1,6 @@ from pydantic import BaseModel, Field, GetCoreSchemaHandler from pydantic_core import CoreSchema, core_schema -from typing import Any, Dict, Generic, List, Optional, TypeVar, UserList, UserDict +from typing import Any, Dict, Generic, List, Optional, TypeVar from .collection_definition_type import CollectionDefinitionType diff --git a/tests/Generator/resource/python/complex/map_property_type.py b/tests/Generator/resource/python/complex/map_property_type.py index e5d373c..ea8a660 100644 --- a/tests/Generator/resource/python/complex/map_property_type.py +++ b/tests/Generator/resource/python/complex/map_property_type.py @@ -1,6 +1,6 @@ from pydantic import BaseModel, Field, GetCoreSchemaHandler from pydantic_core import CoreSchema, core_schema -from typing import Any, Dict, Generic, List, Optional, TypeVar, UserList, UserDict +from typing import Any, Dict, Generic, List, Optional, TypeVar from .collection_property_type import CollectionPropertyType diff --git a/tests/Generator/resource/python/complex/number_property_type.py b/tests/Generator/resource/python/complex/number_property_type.py index 3237b11..d15bed0 100644 --- a/tests/Generator/resource/python/complex/number_property_type.py +++ b/tests/Generator/resource/python/complex/number_property_type.py @@ -1,6 +1,6 @@ from pydantic import BaseModel, Field, GetCoreSchemaHandler from pydantic_core import CoreSchema, core_schema -from typing import Any, Dict, Generic, List, Optional, TypeVar, UserList, UserDict +from typing import Any, Dict, Generic, List, Optional, TypeVar from .scalar_property_type import ScalarPropertyType diff --git a/tests/Generator/resource/python/complex/operation.py b/tests/Generator/resource/python/complex/operation.py index 46497c1..7179cb1 100644 --- a/tests/Generator/resource/python/complex/operation.py +++ b/tests/Generator/resource/python/complex/operation.py @@ -1,6 +1,6 @@ from pydantic import BaseModel, Field, GetCoreSchemaHandler from pydantic_core import CoreSchema, core_schema -from typing import Any, Dict, Generic, List, Optional, TypeVar, UserList, UserDict +from typing import Any, Dict, Generic, List, Optional, TypeVar from .response import Response from .argument import Argument diff --git a/tests/Generator/resource/python/complex/property_type.py b/tests/Generator/resource/python/complex/property_type.py index 16cbf93..19e7fbb 100644 --- a/tests/Generator/resource/python/complex/property_type.py +++ b/tests/Generator/resource/python/complex/property_type.py @@ -1,6 +1,6 @@ from pydantic import BaseModel, Field, GetCoreSchemaHandler from pydantic_core import CoreSchema, core_schema -from typing import Any, Dict, Generic, List, Optional, TypeVar, UserList, UserDict +from typing import Any, Dict, Generic, List, Optional, TypeVar from .string_property_type import StringPropertyType from .integer_property_type import IntegerPropertyType from .number_property_type import NumberPropertyType diff --git a/tests/Generator/resource/python/complex/reference_property_type.py b/tests/Generator/resource/python/complex/reference_property_type.py index 045d003..b0d5b37 100644 --- a/tests/Generator/resource/python/complex/reference_property_type.py +++ b/tests/Generator/resource/python/complex/reference_property_type.py @@ -1,6 +1,6 @@ from pydantic import BaseModel, Field, GetCoreSchemaHandler from pydantic_core import CoreSchema, core_schema -from typing import Any, Dict, Generic, List, Optional, TypeVar, UserList, UserDict +from typing import Any, Dict, Generic, List, Optional, TypeVar from .property_type import PropertyType diff --git a/tests/Generator/resource/python/complex/response.py b/tests/Generator/resource/python/complex/response.py index 84a4378..f44026b 100644 --- a/tests/Generator/resource/python/complex/response.py +++ b/tests/Generator/resource/python/complex/response.py @@ -1,6 +1,6 @@ from pydantic import BaseModel, Field, GetCoreSchemaHandler from pydantic_core import CoreSchema, core_schema -from typing import Any, Dict, Generic, List, Optional, TypeVar, UserList, UserDict +from typing import Any, Dict, Generic, List, Optional, TypeVar from .property_type import PropertyType from .string_property_type import StringPropertyType from .integer_property_type import IntegerPropertyType diff --git a/tests/Generator/resource/python/complex/scalar_property_type.py b/tests/Generator/resource/python/complex/scalar_property_type.py index 9791496..d9f2bed 100644 --- a/tests/Generator/resource/python/complex/scalar_property_type.py +++ b/tests/Generator/resource/python/complex/scalar_property_type.py @@ -1,6 +1,6 @@ from pydantic import BaseModel, Field, GetCoreSchemaHandler from pydantic_core import CoreSchema, core_schema -from typing import Any, Dict, Generic, List, Optional, TypeVar, UserList, UserDict +from typing import Any, Dict, Generic, List, Optional, TypeVar from .string_property_type import StringPropertyType from .integer_property_type import IntegerPropertyType from .number_property_type import NumberPropertyType diff --git a/tests/Generator/resource/python/complex/security.py b/tests/Generator/resource/python/complex/security.py index a609187..ce73ba1 100644 --- a/tests/Generator/resource/python/complex/security.py +++ b/tests/Generator/resource/python/complex/security.py @@ -1,6 +1,6 @@ from pydantic import BaseModel, Field, GetCoreSchemaHandler from pydantic_core import CoreSchema, core_schema -from typing import Any, Dict, Generic, List, Optional, TypeVar, UserList, UserDict +from typing import Any, Dict, Generic, List, Optional, TypeVar from .security_http_basic import SecurityHttpBasic from .security_http_bearer import SecurityHttpBearer from .security_api_key import SecurityApiKey diff --git a/tests/Generator/resource/python/complex/security_api_key.py b/tests/Generator/resource/python/complex/security_api_key.py index 239f5a7..d683a99 100644 --- a/tests/Generator/resource/python/complex/security_api_key.py +++ b/tests/Generator/resource/python/complex/security_api_key.py @@ -1,6 +1,6 @@ from pydantic import BaseModel, Field, GetCoreSchemaHandler from pydantic_core import CoreSchema, core_schema -from typing import Any, Dict, Generic, List, Optional, TypeVar, UserList, UserDict +from typing import Any, Dict, Generic, List, Optional, TypeVar from .security import Security diff --git a/tests/Generator/resource/python/complex/security_http_basic.py b/tests/Generator/resource/python/complex/security_http_basic.py index 74ec14a..231e5bb 100644 --- a/tests/Generator/resource/python/complex/security_http_basic.py +++ b/tests/Generator/resource/python/complex/security_http_basic.py @@ -1,6 +1,6 @@ from pydantic import BaseModel, Field, GetCoreSchemaHandler from pydantic_core import CoreSchema, core_schema -from typing import Any, Dict, Generic, List, Optional, TypeVar, UserList, UserDict +from typing import Any, Dict, Generic, List, Optional, TypeVar from .security import Security diff --git a/tests/Generator/resource/python/complex/security_http_bearer.py b/tests/Generator/resource/python/complex/security_http_bearer.py index 074923e..c85831b 100644 --- a/tests/Generator/resource/python/complex/security_http_bearer.py +++ b/tests/Generator/resource/python/complex/security_http_bearer.py @@ -1,6 +1,6 @@ from pydantic import BaseModel, Field, GetCoreSchemaHandler from pydantic_core import CoreSchema, core_schema -from typing import Any, Dict, Generic, List, Optional, TypeVar, UserList, UserDict +from typing import Any, Dict, Generic, List, Optional, TypeVar from .security import Security diff --git a/tests/Generator/resource/python/complex/security_o_auth.py b/tests/Generator/resource/python/complex/security_o_auth.py index 4f5f193..4902a9e 100644 --- a/tests/Generator/resource/python/complex/security_o_auth.py +++ b/tests/Generator/resource/python/complex/security_o_auth.py @@ -1,6 +1,6 @@ from pydantic import BaseModel, Field, GetCoreSchemaHandler from pydantic_core import CoreSchema, core_schema -from typing import Any, Dict, Generic, List, Optional, TypeVar, UserList, UserDict +from typing import Any, Dict, Generic, List, Optional, TypeVar from .security import Security diff --git a/tests/Generator/resource/python/complex/string_property_type.py b/tests/Generator/resource/python/complex/string_property_type.py index 4a4b4fa..215ac25 100644 --- a/tests/Generator/resource/python/complex/string_property_type.py +++ b/tests/Generator/resource/python/complex/string_property_type.py @@ -1,6 +1,6 @@ from pydantic import BaseModel, Field, GetCoreSchemaHandler from pydantic_core import CoreSchema, core_schema -from typing import Any, Dict, Generic, List, Optional, TypeVar, UserList, UserDict +from typing import Any, Dict, Generic, List, Optional, TypeVar from .scalar_property_type import ScalarPropertyType diff --git a/tests/Generator/resource/python/complex/struct_definition_type.py b/tests/Generator/resource/python/complex/struct_definition_type.py index 9a250f0..45b2dc1 100644 --- a/tests/Generator/resource/python/complex/struct_definition_type.py +++ b/tests/Generator/resource/python/complex/struct_definition_type.py @@ -1,6 +1,6 @@ from pydantic import BaseModel, Field, GetCoreSchemaHandler from pydantic_core import CoreSchema, core_schema -from typing import Any, Dict, Generic, List, Optional, TypeVar, UserList, UserDict +from typing import Any, Dict, Generic, List, Optional, TypeVar from .definition_type import DefinitionType from .reference_property_type import ReferencePropertyType from .property_type import PropertyType diff --git a/tests/Generator/resource/python/complex/type_api.py b/tests/Generator/resource/python/complex/type_api.py index 284042d..ee0d827 100644 --- a/tests/Generator/resource/python/complex/type_api.py +++ b/tests/Generator/resource/python/complex/type_api.py @@ -1,6 +1,6 @@ from pydantic import BaseModel, Field, GetCoreSchemaHandler from pydantic_core import CoreSchema, core_schema -from typing import Any, Dict, Generic, List, Optional, TypeVar, UserList, UserDict +from typing import Any, Dict, Generic, List, Optional, TypeVar from .type_schema import TypeSchema from .security import Security from .operation import Operation diff --git a/tests/Generator/resource/python/complex/type_schema.py b/tests/Generator/resource/python/complex/type_schema.py index 581c868..566ee32 100644 --- a/tests/Generator/resource/python/complex/type_schema.py +++ b/tests/Generator/resource/python/complex/type_schema.py @@ -1,6 +1,6 @@ from pydantic import BaseModel, Field, GetCoreSchemaHandler from pydantic_core import CoreSchema, core_schema -from typing import Any, Dict, Generic, List, Optional, TypeVar, UserList, UserDict +from typing import Any, Dict, Generic, List, Optional, TypeVar from .definition_type import DefinitionType diff --git a/tests/Generator/resource/python/default/author.py b/tests/Generator/resource/python/default/author.py index 8033de9..9c80630 100644 --- a/tests/Generator/resource/python/default/author.py +++ b/tests/Generator/resource/python/default/author.py @@ -1,6 +1,6 @@ from pydantic import BaseModel, Field, GetCoreSchemaHandler from pydantic_core import CoreSchema, core_schema -from typing import Any, Dict, Generic, List, Optional, TypeVar, UserList, UserDict +from typing import Any, Dict, Generic, List, Optional, TypeVar from .location import Location diff --git a/tests/Generator/resource/python/default/location.py b/tests/Generator/resource/python/default/location.py index ffaabf2..b5fe30b 100644 --- a/tests/Generator/resource/python/default/location.py +++ b/tests/Generator/resource/python/default/location.py @@ -1,6 +1,6 @@ from pydantic import BaseModel, Field, GetCoreSchemaHandler from pydantic_core import CoreSchema, core_schema -from typing import Any, Dict, Generic, List, Optional, TypeVar, UserList, UserDict +from typing import Any, Dict, Generic, List, Optional, TypeVar # Location of the person diff --git a/tests/Generator/resource/python/default/meta.py b/tests/Generator/resource/python/default/meta.py index cab59f7..8998729 100644 --- a/tests/Generator/resource/python/default/meta.py +++ b/tests/Generator/resource/python/default/meta.py @@ -1,6 +1,7 @@ from pydantic import BaseModel, Field, GetCoreSchemaHandler from pydantic_core import CoreSchema, core_schema -from typing import Any, Dict, Generic, List, Optional, TypeVar, UserList, UserDict +from typing import Any, Dict, Generic, List, Optional, TypeVar +from collections import UserDict class Meta(UserDict[str, str]): diff --git a/tests/Generator/resource/python/default/news.py b/tests/Generator/resource/python/default/news.py index a4bc9fe..56f91aa 100644 --- a/tests/Generator/resource/python/default/news.py +++ b/tests/Generator/resource/python/default/news.py @@ -1,6 +1,6 @@ from pydantic import BaseModel, Field, GetCoreSchemaHandler from pydantic_core import CoreSchema, core_schema -from typing import Any, Dict, Generic, List, Optional, TypeVar, UserList, UserDict +from typing import Any, Dict, Generic, List, Optional, TypeVar import datetime from .meta import Meta from .author import Author diff --git a/tests/Generator/resource/python/import/import.py b/tests/Generator/resource/python/import/import.py index be15109..b5ae63c 100644 --- a/tests/Generator/resource/python/import/import.py +++ b/tests/Generator/resource/python/import/import.py @@ -1,6 +1,6 @@ from pydantic import BaseModel, Field, GetCoreSchemaHandler from pydantic_core import CoreSchema, core_schema -from typing import Any, Dict, Generic, List, Optional, TypeVar, UserList, UserDict +from typing import Any, Dict, Generic, List, Optional, TypeVar from .student_map import StudentMap from .student import Student diff --git a/tests/Generator/resource/python/import/my_map.py b/tests/Generator/resource/python/import/my_map.py index 55b6eef..ee0d52b 100644 --- a/tests/Generator/resource/python/import/my_map.py +++ b/tests/Generator/resource/python/import/my_map.py @@ -1,6 +1,6 @@ from pydantic import BaseModel, Field, GetCoreSchemaHandler from pydantic_core import CoreSchema, core_schema -from typing import Any, Dict, Generic, List, Optional, TypeVar, UserList, UserDict +from typing import Any, Dict, Generic, List, Optional, TypeVar from .student import Student diff --git a/tests/Generator/resource/python/namespace/import.py b/tests/Generator/resource/python/namespace/import.py index af5c672..8cfe5c6 100644 --- a/tests/Generator/resource/python/namespace/import.py +++ b/tests/Generator/resource/python/namespace/import.py @@ -1,6 +1,6 @@ from pydantic import BaseModel, Field, GetCoreSchemaHandler from pydantic_core import CoreSchema, core_schema -from typing import Any, Dict, Generic, List, Optional, TypeVar, UserList, UserDict +from typing import Any, Dict, Generic, List, Optional, TypeVar from .student_map import StudentMap from .student import Student diff --git a/tests/Generator/resource/python/namespace/my_map.py b/tests/Generator/resource/python/namespace/my_map.py index adda009..ee98d9c 100644 --- a/tests/Generator/resource/python/namespace/my_map.py +++ b/tests/Generator/resource/python/namespace/my_map.py @@ -1,6 +1,6 @@ from pydantic import BaseModel, Field, GetCoreSchemaHandler from pydantic_core import CoreSchema, core_schema -from typing import Any, Dict, Generic, List, Optional, TypeVar, UserList, UserDict +from typing import Any, Dict, Generic, List, Optional, TypeVar from .student import Student diff --git a/tests/Generator/resource/python/oop/human_map.py b/tests/Generator/resource/python/oop/human_map.py index ac25547..61eed1a 100644 --- a/tests/Generator/resource/python/oop/human_map.py +++ b/tests/Generator/resource/python/oop/human_map.py @@ -1,6 +1,6 @@ from pydantic import BaseModel, Field, GetCoreSchemaHandler from pydantic_core import CoreSchema, core_schema -from typing import Any, Dict, Generic, List, Optional, TypeVar, UserList, UserDict +from typing import Any, Dict, Generic, List, Optional, TypeVar from .map import Map from .human_type import HumanType diff --git a/tests/Generator/resource/python/oop/human_type.py b/tests/Generator/resource/python/oop/human_type.py index 94b7912..1490f57 100644 --- a/tests/Generator/resource/python/oop/human_type.py +++ b/tests/Generator/resource/python/oop/human_type.py @@ -1,6 +1,6 @@ from pydantic import BaseModel, Field, GetCoreSchemaHandler from pydantic_core import CoreSchema, core_schema -from typing import Any, Dict, Generic, List, Optional, TypeVar, UserList, UserDict +from typing import Any, Dict, Generic, List, Optional, TypeVar from .human_type import HumanType diff --git a/tests/Generator/resource/python/oop/map.py b/tests/Generator/resource/python/oop/map.py index 5952d66..8a5d098 100644 --- a/tests/Generator/resource/python/oop/map.py +++ b/tests/Generator/resource/python/oop/map.py @@ -1,6 +1,6 @@ from pydantic import BaseModel, Field, GetCoreSchemaHandler from pydantic_core import CoreSchema, core_schema -from typing import Any, Dict, Generic, List, Optional, TypeVar, UserList, UserDict +from typing import Any, Dict, Generic, List, Optional, TypeVar P = TypeVar("P") diff --git a/tests/Generator/resource/python/oop/root_schema.py b/tests/Generator/resource/python/oop/root_schema.py index 7f9dc17..84c95ba 100644 --- a/tests/Generator/resource/python/oop/root_schema.py +++ b/tests/Generator/resource/python/oop/root_schema.py @@ -1,6 +1,6 @@ from pydantic import BaseModel, Field, GetCoreSchemaHandler from pydantic_core import CoreSchema, core_schema -from typing import Any, Dict, Generic, List, Optional, TypeVar, UserList, UserDict +from typing import Any, Dict, Generic, List, Optional, TypeVar from .student_map import StudentMap diff --git a/tests/Generator/resource/python/oop/student.py b/tests/Generator/resource/python/oop/student.py index f879657..3b3bb3c 100644 --- a/tests/Generator/resource/python/oop/student.py +++ b/tests/Generator/resource/python/oop/student.py @@ -1,6 +1,6 @@ from pydantic import BaseModel, Field, GetCoreSchemaHandler from pydantic_core import CoreSchema, core_schema -from typing import Any, Dict, Generic, List, Optional, TypeVar, UserList, UserDict +from typing import Any, Dict, Generic, List, Optional, TypeVar from .human_type import HumanType diff --git a/tests/Generator/resource/python/oop/student_map.py b/tests/Generator/resource/python/oop/student_map.py index 1c7a668..84c0ec3 100644 --- a/tests/Generator/resource/python/oop/student_map.py +++ b/tests/Generator/resource/python/oop/student_map.py @@ -1,6 +1,6 @@ from pydantic import BaseModel, Field, GetCoreSchemaHandler from pydantic_core import CoreSchema, core_schema -from typing import Any, Dict, Generic, List, Optional, TypeVar, UserList, UserDict +from typing import Any, Dict, Generic, List, Optional, TypeVar from .map import Map from .human_type import HumanType from .student import Student