diff --git a/requirements/base.txt b/requirements/base.txt index cbf14667d..0135fea0f 100755 --- a/requirements/base.txt +++ b/requirements/base.txt @@ -4,4 +4,4 @@ typing_extensions>=4.4 # 3.8 doesn't have Required, TypeGuard and ParamSpec # resource validation & schema generation # 1.10.15 and 1.10.17 included breaking change from pydantic, more info: https://github.com/aws/serverless-application-model/issues/3617 -pydantic>=1.8,<3,!=1.10.15,!=1.10.17 +pydantic>=1.10.18,<3 diff --git a/samtranslator/compat.py b/samtranslator/compat.py index 7d2686d56..a6269b44d 100644 --- a/samtranslator/compat.py +++ b/samtranslator/compat.py @@ -3,7 +3,7 @@ # Starting Pydantic v1.10.17, pydantic import v1 will success, # adding the following line to make Pydantic v1 should fall back to v1 import correctly. - pydantic.error_wrappers.ValidationError # noqa + pydantic.ValidationError # noqa except ImportError: # Unfortunately mypy cannot handle this try/expect pattern, and "type: ignore" # is the simplest work-around. See: https://github.com/python/mypy/issues/1153 diff --git a/samtranslator/model/__init__.py b/samtranslator/model/__init__.py index e47131793..685b45138 100644 --- a/samtranslator/model/__init__.py +++ b/samtranslator/model/__init__.py @@ -345,7 +345,7 @@ def validate_properties_and_return_model(self, cls: Type[RT]) -> RT: """ try: return cls.parse_obj(self._generate_resource_dict()["Properties"]) - except pydantic.error_wrappers.ValidationError as e: + except pydantic.ValidationError as e: error_properties: str = "" with suppress(KeyError): error_properties = ".".join(str(x) for x in e.errors()[0]["loc"])