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

Migrate Viz to use Pydantic V2 #1743

Merged
merged 10 commits into from
Feb 21, 2024
Merged

Conversation

ravi-kumar-pilla
Copy link
Contributor

@ravi-kumar-pilla ravi-kumar-pilla commented Feb 9, 2024

Description

Resolves #1603

Development notes

  • Followed pydantic migration guide
  • Partially updated code using bump-pydantic tool
  • Manually updated @validators to @field_validators
  • Updated requirements.txt with new pydantic version
  • Updated test files as per lint suggestions

QA notes

  • All pytests should pass and kedro viz run should work as expected

Note: Observed flowchart node arrangements change (mirrored) due to the migration, though the data remains un-affected as below -

Before Migration:

current_placement

After Migration:
pydantic_v2_placement

Checklist

  • Read the contributing guidelines
  • Opened this PR as a 'Draft Pull Request' if it is work-in-progress
  • Updated the documentation to reflect the code changes
  • Added new entries to the RELEASE.md file
  • Added tests to cover my changes

Signed-off-by: ravi-kumar-pilla <ravi_kumar_pilla@mckinsey.com>
Signed-off-by: ravi-kumar-pilla <ravi_kumar_pilla@mckinsey.com>
@astrojuanlu
Copy link
Member

It's happeninggggggggg

Signed-off-by: ravi-kumar-pilla <ravi_kumar_pilla@mckinsey.com>
Signed-off-by: ravi-kumar-pilla <ravi_kumar_pilla@mckinsey.com>
Signed-off-by: ravi-kumar-pilla <ravi_kumar_pilla@mckinsey.com>
@MarkusSagen
Copy link

Fantastic!!

@@ -2,7 +2,7 @@ packaging~=23.0
kedro>=0.18.0
ipython>=7.0.0, <9.0
fastapi>=0.73.0,<0.200.0
pydantic<2
pydantic>=2
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we need to put this, or should we just bump the minimum version of fastAPI ?

…irements

Signed-off-by: ravi-kumar-pilla <ravi_kumar_pilla@mckinsey.com>
@@ -13,4 +13,3 @@ strawberry-graphql==0.192.0
networkx==2.5
orjson==3.9
secure==0.3.0
pydantic==1.10
Copy link
Contributor

Choose a reason for hiding this comment

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

This seems different from the discussion in #1603. Just to confirm, we are dropping Pydantic v1 support altogether now.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes we are dropping support for pydantic v1 as there are issues with the v1 api mentioned here and an open PR - https://github.com/tiangolo/fastapi/pull/10223/files

Copy link

@DimedS DimedS left a comment

Choose a reason for hiding this comment

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

Thank you for the PR, @ravi-kumar-pilla . LGTM! Let's move on to v2! 🎉 🎉

Copy link
Contributor

@rashidakanchwala rashidakanchwala left a comment

Choose a reason for hiding this comment

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

great work ! thanks @ravi-kumar-pilla

Signed-off-by: ravi-kumar-pilla <ravi_kumar_pilla@mckinsey.com>
Signed-off-by: ravi-kumar-pilla <ravi_kumar_pilla@mckinsey.com>
@ravi-kumar-pilla ravi-kumar-pilla merged commit fdcda72 into main Feb 21, 2024
14 checks passed
@ravi-kumar-pilla ravi-kumar-pilla deleted the feature/migrate-pydantic-v1-v2 branch February 21, 2024 16:05
@ravi-kumar-pilla ravi-kumar-pilla mentioned this pull request Mar 1, 2024
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support for Pydantic V2 [Planned for Q1 2024]
6 participants