Skip to content

Conversation

@potiuk
Copy link
Member

@potiuk potiuk commented 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.


^ 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 potiuk added this to the Airflow 2.7.1 milestone Sep 4, 2023
@ephraimbuddy
Copy link
Contributor

Should we update here too:

return hasattr(cls, "model_config") and hasattr(cls, "model_fields") and hasattr(cls, "model_fields_set")
?
Like reverting the change in 33956?

@potiuk
Copy link
Member Author

potiuk commented Sep 4, 2023

Should we update here too:

return hasattr(cls, "model_config") and hasattr(cls, "model_fields") and hasattr(cls, "model_fields_set")

?
Like reverting the change in 33956?

Good point. We do not reallly use it (yet) - it's been added for AIP-44 but it'sa good point to add check that is v1 and v2 compatible for now

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 potiuk force-pushed the bring-back-pydantic-1-compatibility branch from 440af43 to 59b6d8b Compare September 4, 2023 16:20
@potiuk
Copy link
Member Author

potiuk commented Sep 4, 2023

Updated.

Copy link
Contributor

@eladkal eladkal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The cost of trying be ahead :)

@potiuk
Copy link
Member Author

potiuk commented Sep 4, 2023

The cost of trying be ahead :)

Living on the edge

@potiuk
Copy link
Member Author

potiuk commented Sep 4, 2023

Just a flaky XCom map test that could be likely avoided if we merge #33309

@potiuk potiuk merged commit 30ddfc5 into apache:main Sep 4, 2023
@potiuk potiuk deleted the bring-back-pydantic-1-compatibility branch September 4, 2023 17:24
@potiuk
Copy link
Member Author

potiuk commented Sep 4, 2023

Merged @ephraimbuddy

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)
@JeroenWilkens
Copy link

Hi @potiuk,
Thank you for bringing back support for pydantic v1. This helps us with running Great Expectations on Airflow v2.7.1.

I just noticed however when upgrading, in the constraints file (python 3.8), pydantic is still pinned to version 2.3.0.

@potiuk
Copy link
Member Author

potiuk commented Sep 19, 2023

I just noticed however when upgrading, in the constraints file (python 3.8), pydantic is still pinned to version 2.3.0.

Of course. This is the version that is tested and runs with 2.7.1. If you want to downgrade or upgrade any dependency that is different from constraints you should not use constraints. See the docs https://airflow.apache.org/docs/apache-airflow/stable/installation/installing-from-pypi.html#upgrading-and-installing-dependencies-including-providers

@ephraimbuddy ephraimbuddy added the type:bug-fix Changelog: Bug Fixes label Oct 3, 2023
@potiuk potiuk mentioned this pull request Nov 9, 2023
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants