Skip to content

Upgrade to pydantic2 #368

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

Merged
merged 3 commits into from
May 3, 2024
Merged

Upgrade to pydantic2 #368

merged 3 commits into from
May 3, 2024

Conversation

BenGalewsky
Copy link
Contributor

Background

Pydantic V2 is a ground-up rewrite that offers many new features, performance improvements, and some breaking changes compared to Pydantic V1. The main reasons for the changes include:

  • Significant performance improvements: Based on benchmarks, Pydantic v2 is between 4x and 50x faster than Pydantic v1.
  • Improved reliability and consistency: Pydantic v2 offers a strict mode that no longer magically coerces data, clear rules on required vs nullable fields, and more flexible validation options.
  • New features: Pydantic V2 introduces many new features, such as support for autocomplete in VS Code via dataclass_transform.
  • Breaking changes: While the transition to Pydantic V2 requires some breaking changes, the changes are not so numerous or game-changing that they cannot be understood by reading the documentation. The migration guide and new API docs provide detailed information on the changes between V1 and V2.
  • Maintainability: The aggressive removals between major versions are likely better for maintainability, considering Pydantic's complexity and the fact that it was basically a rewrite

Copy link

codecov bot commented May 2, 2024

Codecov Report

Attention: Patch coverage is 97.18310% with 2 lines in your changes are missing coverage. Please review.

Project coverage is 73.88%. Comparing base (5bc25f1) to head (9604c29).

Files Patch % Lines
servicex/databinder_models.py 93.93% 2 Missing ⚠️
Additional details and impacted files
@@               Coverage Diff               @@
##           3.0_develop     #368      +/-   ##
===============================================
+ Coverage        73.78%   73.88%   +0.10%     
===============================================
  Files               42       42              
  Lines             2300     2305       +5     
===============================================
+ Hits              1697     1703       +6     
+ Misses             603      602       -1     
Flag Coverage Δ
unittests 73.88% <97.18%> (+0.10%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@BenGalewsky BenGalewsky requested a review from kyungeonchoi May 2, 2024 15:04
@matthewfeickert
Copy link
Member

Resolves #363

Copy link
Contributor

@kyungeonchoi kyungeonchoi left a comment

Choose a reason for hiding this comment

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

Working nicely!

@matthewfeickert
Copy link
Member

Once this is merged in, can a 3.0.0-alpha.16 release please be made as well? I can use that to update the AB-dev container images.

@kyungeonchoi
Copy link
Contributor

@matthewfeickert - if you are referring to the ServiceX client version in the ATLAS idap repo that's still in the another branch (3.0_develop_uprootraw). It includes some refactoring so we are planning to merge after having a discussion during the coming ServiceX chat :)

@matthewfeickert
Copy link
Member

matthewfeickert commented May 2, 2024

if you are referring to the ServiceX client version in the ATLAS idap repo

More broadly than the repo but iris-hep/idap-200gbps-atlas#60 in general with the servicex client getting added to the install list in https://github.com/usatlas/analysisbase-dask.

that's still in the another branch (3.0_develop_uprootraw). It includes some refactoring so we are planning to merge after having a discussion during the coming ServiceX chat

I guess I'm confused about how development is done here, but that branch is a separate feature request,

3.0_develop...3.0_develop_uprootraw

,so why isn't that branch just rebased off of 3.0_develop and updated to the new pydantic after this is merged in?

@BenGalewsky BenGalewsky merged commit 27c94a8 into 3.0_develop May 3, 2024
34 checks passed
@BenGalewsky BenGalewsky deleted the pydantic2 branch May 3, 2024 02:27
@matthewfeickert
Copy link
Member

Thanks @BenGalewsky, for the great PR and for merging this in!

@kyungeonchoi I'm sorry earlier for writing a note hastily and without proper clarity. I didn't mean to suggest that a alpha release be cut from the 3.0_develop_uprootraw branch (until 3.0_develop is merged into main with the 3.0 release I assume that all alpha and rcs will be cut from the 3.0_develop branch). I had misunderstood

It includes some refactoring so we are planning to merge after having a discussion during the coming ServiceX chat

to mean that you were waiting on 3.0_develop_uprootraw to merge it into this PR's branch. But I understand that I was mistaken now, and if I attended the serviceX meetings I probably wouldn't be.

I can't promise that I'll be at the Friday 2024-05-03 meeting, but if the 3.0_develop_uprootraw branch isn't ready to PR tomorrow would it still be possible to make another alpha release now that this PR is in?

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.

3 participants