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

[DOP-13337] Add Pydantic v2 compatibility #82

Merged
merged 1 commit into from
Mar 5, 2024
Merged

Conversation

dolfinus
Copy link
Member

@dolfinus dolfinus commented Mar 5, 2024

Change Summary

Pydantic v2 provides a nice way to upgrade to new version without much modifying source code. Just replace from pydantic import ... with from pydantic.v1 import ..., and that's all.

Wrapped all imports with try:.. except ImportError: ... (to handle both v1 and v2 imports), and added Pydantic v2 to CI matrix.

Related issue number

Checklist

  • Commit message and PR title is comprehensive
  • Keep the change as small as possible
  • Unit and integration tests for the changes exist
  • Tests pass on CI and coverage does not decrease
  • Documentation reflects the changes where applicable
  • docs/changelog/next_release/<pull request or issue id>.<change type>.rst file added describing change
    (see CONTRIBUTING.rst for details.)
  • My PR is ready to review.

@dolfinus dolfinus self-assigned this Mar 5, 2024
Copy link

codecov bot commented Mar 5, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 96.68%. Comparing base (5eceb38) to head (70a83f4).

Additional details and impacted files
@@             Coverage Diff             @@
##           develop      #82      +/-   ##
===========================================
+ Coverage    96.45%   96.68%   +0.22%     
===========================================
  Files           50       50              
  Lines         1129     1205      +76     
  Branches       202      202              
===========================================
+ Hits          1089     1165      +76     
  Misses          23       23              
  Partials        17       17              

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

@dolfinus dolfinus merged commit 6bb3e87 into develop Mar 5, 2024
16 checks passed
@dolfinus dolfinus deleted the feature/DOP-13337 branch March 5, 2024 09:22
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.

None yet

2 participants