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

Fix pydantic warning about orm_mode rename #33220

Merged
merged 3 commits into from
Aug 9, 2023

Conversation

ephraimbuddy
Copy link
Contributor

Pydantic 2 renamed orm_mode to from_attributes. This was missed during the upgrade to pydantic 2 and it gives excessive warnings about the rename. This PR fixes it

Pydantic 2 renamed orm_mode to from_attributes. This was missed during the upgrade to pydantic 2 and it gives excessive warning about the rename.
This PR fixes it
@ephraimbuddy ephraimbuddy added this to the Airflow 2.7.0 milestone Aug 8, 2023
@ephraimbuddy ephraimbuddy added changelog:skip Changes that should be skipped from the changelog (CI, tests, etc..) type:misc/internal Changelog: Misc changes that should appear in change log and removed changelog:skip Changes that should be skipped from the changelog (CI, tests, etc..) labels Aug 8, 2023
@ephraimbuddy
Copy link
Contributor Author

Looks like we can't fix this due to breeze having pydantic 1.

@potiuk
Copy link
Member

potiuk commented Aug 8, 2023

Why don't we simply limit pydantic to <2 for now ?

@potiuk
Copy link
Member

potiuk commented Aug 8, 2023

#33235 - PR ready for review

@uranusjr
Copy link
Member

uranusjr commented Aug 9, 2023

I added a commit to make this compatible with both Pydantic 1.x and 2.x.

@potiuk potiuk merged commit 75bb04b into apache:main Aug 9, 2023
42 checks passed
@uranusjr uranusjr deleted the rename-orm-mode branch August 9, 2023 09:40
ephraimbuddy added a commit that referenced this pull request Aug 28, 2023
* Fix pydantic warning about `orm_mode` rename

Pydantic 2 renamed orm_mode to from_attributes. This was missed during the upgrade to pydantic 2 and it gives excessive warning about the rename.
This PR fixes it

* Also rename from_orm to model_validate and use model_dump instead of dict

* Fix Pydantic 1.x compatibility

---------

Co-authored-by: Tzu-ping Chung <[email protected]>
(cherry picked from commit 75bb04b)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:serialization 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