Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Several tests fail with Pydantic 1.10.17 (latest 1.x) #3617

Closed
musicinmybrain opened this issue Jun 20, 2024 · 5 comments
Closed

Several tests fail with Pydantic 1.10.17 (latest 1.x) #3617

musicinmybrain opened this issue Jun 20, 2024 · 5 comments
Labels
stage/needs-triage Automatically applied to new issues and PRs, indicating they haven't been looked at.

Comments

@musicinmybrain
Copy link
Contributor

Description

After I reported #3600 about Pydantic 1.10.15, the release of Pydantic 1.10.16 fixed the problem – but then 1.10.17 broke it again.

Steps to reproduce

$ gh repo clone aws/serverless-application-model
$ cd serverless-application-model
$ python3 -m venv _e
$ . _e/bin/activate
(_e) $ pip install -e .[dev]
(_e) $ pip install pydantic==1.10.17
(_e) $ make test

Interestingly, I can also reproduce this on the develop branch, which includes #3611 – using either pydantic==1.10.15 or pydantic==1.10.17 – so it doesn’t look like that PR works as intended.

Observed result

=========================================================================================== short test summary info ============================================================================================
FAILED tests/model/test_resource_validator.py::TestResourceValidatorFailure::test_connector_with_empty_properties - AttributeError: module 'pydantic.v1' has no attribute 'error_wrappers'
FAILED tests/model/test_resource_validator.py::TestResourceValidatorFailure::test_connector_with_invalid_permission - AttributeError: module 'pydantic.v1' has no attribute 'error_wrappers'
FAILED tests/model/test_resource_validator.py::TestResourceValidatorFailure::test_connector_with_invalid_permission_type - AttributeError: module 'pydantic.v1' has no attribute 'error_wrappers'
FAILED tests/model/test_resource_validator.py::TestResourceValidatorFailure::test_connector_without_source - AttributeError: module 'pydantic.v1' has no attribute 'error_wrappers'
FAILED tests/translator/test_translator.py::test_transform_invalid_document[error_graphqlapi] - AttributeError: module 'pydantic.v1' has no attribute 'error_wrappers'
============================================================================== 5 failed, 3967 passed, 5 rerun in 99.69s (0:01:39) ==============================================================================

Expected result

(_e) $ pip install pydantic==1.10.16
(_e) $ make test
======================================================================================= 3972 passed in 103.12s (0:01:43) =======================================================================================

Additional environment details

  1. OS: Fedora 40 x86_64
  2. If using the SAM CLI, sam --version: N/A
  3. AWS region: N/A
@musicinmybrain musicinmybrain added the stage/needs-triage Automatically applied to new issues and PRs, indicating they haven't been looked at. label Jun 20, 2024
@aaythapa
Copy link
Contributor

Thanks again for reporting this. I was able to reproduce with 1.10.17. Created issue with pydantic: pydantic/pydantic#9742

@aaythapa
Copy link
Contributor

Hi there, we were going to release an update to fix the error catch so that the AttributeError when running unit test anymore but we thought it be best to wait for pydantic to release a fix on their end. We'd have to revert the PR anyways after they released the fix

For now you can pin the 1.10.15 pydantic version in your base.txt to workaround this issue.

@musicinmybrain
Copy link
Contributor Author

For now you can pin the 1.10.15 pydantic version in your base.txt to workaround this issue.

Indeed, in Fedora 39 and EPEL9 we’re keeping the package for Pydantic at 1.10.14, possibly indefinitely, but at least until there is a release with the pydantic.v1 backport that doesn’t break anything, and we have some time to build confidence that all of the issues have been worked out. In Fedora 40 and later, Pydantic is at 2.x and tracking the latest release, so all’s well.

@aaythapa
Copy link
Contributor

pushed pr to exclude breaking pydantic versions so closing this issue, thanks again for reporting

Copy link
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stage/needs-triage Automatically applied to new issues and PRs, indicating they haven't been looked at.
Projects
None yet
Development

No branches or pull requests

2 participants