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

[REF] Upgrade codebase to Pydantic>2 #389

Merged
merged 22 commits into from
Nov 15, 2024
Merged

[REF] Upgrade codebase to Pydantic>2 #389

merged 22 commits into from
Nov 15, 2024

Conversation

alyssadai
Copy link
Contributor

@alyssadai alyssadai commented Nov 12, 2024

Changes proposed in this pull request:

  • Bump Pydantic to latest version (2.9.2) and upgrade dependencies
  • Replace deprecated Pydantic model, field configuration, and validation method names/syntax
    • Add type annotation to all fields as now required
  • Refactor generate_context() using more standard methods to accommodate changes to Pydantic internals
  • Replace deprecated DataFrame.applymap to suppress deprecation warnings
  • Remove Python 3.9 and added 3.11 to the test runner matrix (3.9 is no longer compatible with the dependency updates introduced in this PR using pip-compile)

Checklist

This section is for the PR reviewer

  • PR has an interpretable title with a prefix ([ENH], [FIX], [REF], [TST], [CI], [MNT], [INF], [MODEL], [DOC]) (see our Contributing Guidelines for more info)
  • PR has a label for the release changelog or skip-release (to be applied by maintainers only)
  • PR links to GitHub issue with mention Closes #XXXX
  • Tests pass
  • Checks pass

For new features:

  • Tests have been added

For bug fixes:

  • There is at least one test that would fail under the original bug conditions.

@alyssadai alyssadai added the pr-dependencies Update one or more dependencies version label Nov 12, 2024
Copy link

codecov bot commented Nov 12, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.36%. Comparing base (3156101) to head (0147316).
Report is 7 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #389      +/-   ##
==========================================
- Coverage   98.36%   98.36%   -0.01%     
==========================================
  Files          21       18       -3     
  Lines         980      977       -3     
==========================================
- Hits          964      961       -3     
  Misses         16       16              

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


🚨 Try these New Features:

@coveralls
Copy link
Collaborator

coveralls commented Nov 12, 2024

Pull Request Test Coverage Report for Build 11849787896

Details

  • 51 of 51 (100.0%) changed or added relevant lines in 6 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-0.005%) to 98.362%

Totals Coverage Status
Change from base Build 11812239829: -0.005%
Covered Lines: 961
Relevant Lines: 977

💛 - Coveralls

@alyssadai alyssadai marked this pull request as ready for review November 13, 2024 08:01
Copy link
Contributor

@surchs surchs left a comment

Choose a reason for hiding this comment

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

Thanks @alyssadai, that's awesome. Very nice that we can finally close this!

Everything looks nice, left some comments, but 🧑‍🍳

bagel/dictionary_models.py Outdated Show resolved Hide resolved
bagel/dictionary_models.py Show resolved Hide resolved
bagel/dictionary_models.py Show resolved Hide resolved
bagel/dictionary_models.py Show resolved Hide resolved
bagel/dictionary_models.py Outdated Show resolved Hide resolved
bagel/dictionary_models.py Show resolved Hide resolved
bagel/utilities/model_utils.py Show resolved Hide resolved
bagel/utilities/pheno_utils.py Show resolved Hide resolved
setup.cfg Show resolved Hide resolved
@alyssadai alyssadai merged commit b1823ee into main Nov 15, 2024
11 checks passed
@alyssadai alyssadai deleted the pydantic-v2-refactor branch November 15, 2024 03:36
Copy link
Contributor

🚀 PR was released in v0.3.4 🚀

@neurobagel-bot neurobagel-bot bot added the released This issue/pull request has been released. label Nov 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr-dependencies Update one or more dependencies version released This issue/pull request has been released.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Migrate to Pydantic v2
3 participants