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

Upgrade to Pydantic 2 #33956

Merged
merged 1 commit into from
Aug 31, 2023
Merged

Conversation

potiuk
Copy link
Member

@potiuk potiuk commented Aug 31, 2023

The only blocking factor to migrate to Pydantic 2 was the
aws-sam-translator which was transitive dependency to
moto[cloudformation] via cfn-lint and we do not really need
everything in that extra - used only for testing.

While aws-sam-translator is already preparing to release Pydantic 2
compatible version, we do not want to wait - instead we replace the
cloudformation extra with openapi_spec_validator and jsonschema
needed by the cloudformation tests.


^ Add meaningful description above
Read the Pull Request Guidelines for more information.
In case of fundamental code changes, an Airflow Improvement Proposal (AIP) is needed.
In case of a new dependency, check compliance with the ASF 3rd Party License Policy.
In case of backwards incompatible changes please leave a note in a newsfragment file, named {pr_number}.significant.rst or {issue_number}.significant.rst, in newsfragments.

@potiuk
Copy link
Member Author

potiuk commented Aug 31, 2023

Checking if a) it will bring pydantic 2 b) whether it is really needed for the AWS tests.

@potiuk potiuk force-pushed the remove-cloudformation-from-moto branch 2 times, most recently from 70f4fe8 to 6e25123 Compare August 31, 2023 13:49
@potiuk potiuk changed the title Remove cloudformation as moto extra Upgrade to Pydantic 2 Aug 31, 2023
@potiuk potiuk marked this pull request as ready for review August 31, 2023 13:50
@potiuk potiuk added this to the Airflow 2.7.1 milestone Aug 31, 2023
@potiuk potiuk force-pushed the remove-cloudformation-from-moto branch 2 times, most recently from 9cd16da to 72af244 Compare August 31, 2023 13:57
@potiuk
Copy link
Member Author

potiuk commented Aug 31, 2023

Seems that we do not need cnf-lint - just openapi_schema_validator and jsonschema ... And we can upgrade to Pydantic 2 NOW. It also needed to fix our test case to replace removed parse_raw_data

@potiuk potiuk force-pushed the remove-cloudformation-from-moto branch from 72af244 to c189fb9 Compare August 31, 2023 15:28
The only blocking factor to migrate to Pydantic 2 was the
aws-sam-translator which was transitive dependency to
`moto[cloudformation]` via `cfn-lint` and we do not really need
everything in that extra - used only for testing.

While aws-sam-translator is already preparing to release Pydantic 2
compatible version, we do not want to wait - instead we replace the
cloudformation extra with openapi_spec_validator and jsonschema
needed by the cloudformation tests.
@potiuk
Copy link
Member Author

potiuk commented Aug 31, 2023

I had to also fix Pydantic serialization detection

@potiuk potiuk merged commit 1cda0c3 into apache:main Aug 31, 2023
64 checks passed
@potiuk potiuk deleted the remove-cloudformation-from-moto branch August 31, 2023 20:56
potiuk added a commit to potiuk/airflow that referenced this pull request Aug 31, 2023
With latest change enabling Pydantic apache#33956 some old dependencies
(aws-sam-translator) remained in the CI image from cached
installation and they are breaking `pip check` when refreshing
the image cache. This PR bumps EPOCH numbers so that the dependencies
are not installed from cache and we have a clean, new image with
just those depencies we need.
potiuk added a commit that referenced this pull request Aug 31, 2023
With latest change enabling Pydantic #33956 some old dependencies
(aws-sam-translator) remained in the CI image from cached
installation and they are breaking `pip check` when refreshing
the image cache. This PR bumps EPOCH numbers so that the dependencies
are not installed from cache and we have a clean, new image with
just those depencies we need.
@ephraimbuddy ephraimbuddy added the type:misc/internal Changelog: Misc changes that should appear in change log label Sep 1, 2023
ephraimbuddy pushed a commit that referenced this pull request Sep 1, 2023
With latest change enabling Pydantic #33956 some old dependencies
(aws-sam-translator) remained in the CI image from cached
installation and they are breaking `pip check` when refreshing
the image cache. This PR bumps EPOCH numbers so that the dependencies
are not installed from cache and we have a clean, new image with
just those depencies we need.

(cherry picked from commit dd7cc87)
ephraimbuddy pushed a commit that referenced this pull request Sep 1, 2023
The only blocking factor to migrate to Pydantic 2 was the
aws-sam-translator which was transitive dependency to
`moto[cloudformation]` via `cfn-lint` and we do not really need
everything in that extra - used only for testing.

While aws-sam-translator is already preparing to release Pydantic 2
compatible version, we do not want to wait - instead we replace the
cloudformation extra with openapi_spec_validator and jsonschema
needed by the cloudformation tests.

(cherry picked from commit 1cda0c3)
potiuk added a commit to potiuk/airflow that referenced this pull request Sep 4, 2023
The apache#33956 and apache#33998 updated limits for Pydantic to Pydantic 2
only and removed Pydantic 1 compatibility. However it turns out
that some of important 3rd-party libraries have not yet upgraded
and it will make it impossible to install them on Airflow 2.7.1+
if we keep the limit.

For now we bring back Pydantic 1 compatibility, we remove the limit
and filter the warnings that made us remove the compatibility code.
potiuk added a commit that referenced this pull request Sep 4, 2023
The #33956 and #33998 updated limits for Pydantic to Pydantic 2
only and removed Pydantic 1 compatibility. However it turns out
that some of important 3rd-party libraries have not yet upgraded
and it will make it impossible to install them on Airflow 2.7.1+
if we keep the limit.

For now we bring back Pydantic 1 compatibility, we remove the limit
and filter the warnings that made us remove the compatibility code.
ephraimbuddy pushed a commit that referenced this pull request Sep 4, 2023
The #33956 and #33998 updated limits for Pydantic to Pydantic 2
only and removed Pydantic 1 compatibility. However it turns out
that some of important 3rd-party libraries have not yet upgraded
and it will make it impossible to install them on Airflow 2.7.1+
if we keep the limit.

For now we bring back Pydantic 1 compatibility, we remove the limit
and filter the warnings that made us remove the compatibility code.

(cherry picked from commit 30ddfc5)
@eladkal eladkal mentioned this pull request Oct 14, 2023
@sinwoobang sinwoobang mentioned this pull request Nov 22, 2023
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:misc/internal Changelog: Misc changes that should appear in change log
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants