Closed musicinmybrain closed 5 months ago
In Pydantic 1.10.14, from pydantic import v1 as pydantic
raises an ImportError
in
and import pydantic
is used.
In Pydantic 1.10.14, from pydantic import v1 as pydantic
succeeds, but pydantic.v1.error_wrappers
is not present, only pydantic.error_wrappers
; therefore, samtranslator.compat.pydantic.error_wrappers
is not present.
I’ll try to offer a PR for this later today.
I’ll try to offer a PR for this later today.
I am actually not sure what the correct approach is here. Using pydantic.ValidationError
in the except …:
isn’t right (on Pydantic v2, it is pydantic_core._pydantic_core.ValidationError
, which has no direct inheritance relationship with pydantic.v1.error_wrappers.ValidationError
).
It seems like it might be a bug that pydantic.v1.error_wrappers
isn’t present in Pydantic 1.10.15, and that this might be the same as https://github.com/pydantic/pydantic/issues/9357, but I don’t have enough Pydantic experience to state that confidently.
Was able to reproduce this issue on local
Issue opened with pydantic team for import error https://github.com/pydantic/pydantic/issues/9625
Thanks @musicinmybrain for highlighting this issue. We've opened a bug at pydantic end to check this, meanwhile added this to list of expected exception at SAM end in PR#3611 . Let us know if you still have any questions regarding this.
This issue is now closed. Comments on closed issues are hard for our team to see. If you need more assistance, please either tag a team member or open a new issue that references this one.
Description
Pydantic 1.10.15 aliases the
pydantic
namespace aspydantic.v1
as a forward-compatibility feature. This seems to interact badly with severalSteps to reproduce
Observed result
Expected result
Additional environment details
x86_64
sam --version
: N/A