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

Upgrade Harmony API to Pydantic v2 #8

Merged
merged 4 commits into from
Aug 20, 2024

Conversation

olp-cs
Copy link
Contributor

@olp-cs olp-cs commented Aug 12, 2024

Description

Related to harmonydata/harmony#50

Related PR and discussion: harmonydata/harmony#51

  • Removed Rocketry: it's not compatible with Pydantic V2 and will be replaced with another library @zaironjacobs
  • BaseSettings has moved to a separate package, pydantic-settings.

Testing

Tested on a local system: Ubuntu 24.04 LTS (step-by-step description)

python -m unittest discover tests/local_tests

Before the changes: 18/18 passed
After the changes: 18/18 passed

@zaironjacobs
Copy link
Collaborator

@olp-cs There are some deprecated pydantic functions that sill work, but it would be good to update them also to the recommended functions used in v2.

dict() to model_dump(mode="json").
parse_raw(...) to model_validate_json(...).

@olp-cs
Copy link
Contributor Author

olp-cs commented Aug 19, 2024

@zaironjacobs I think I have updated it, but please let me know if there is anything else I might have missed.

@woodthom2 woodthom2 merged commit 25a3634 into harmonydata:main Aug 20, 2024
1 check passed
@woodthom2
Copy link
Contributor

Thanks @olp-cs !

@olp-cs olp-cs deleted the upgrade-api-to-pydantic-v2 branch August 27, 2024 13:40
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