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

update(pydantic) #104

Closed
wants to merge 14 commits into from
Closed

update(pydantic) #104

wants to merge 14 commits into from

Conversation

ChrOertlin
Copy link
Contributor

Added

Update to pydantic v2

Changed

Fixed

Steps to consider while deploying

  • Configuration changes:
  • Documentation updates:
  • Inform users by email:

Review:

  • Code approved by
  • Tests executed on stage by: (Document the test done with screen shots and description.)
  • "Merge and deploy" approved by

This version is a:

  • MAJOR - when you make incompatible API changes
  • MINOR - when you add functionality in a backwards compatible manner
  • PATCH - when you make backwards compatible bug fixes or documentation/instructions

@ChrOertlin ChrOertlin requested a review from a team as a code owner March 14, 2024 13:54
Copy link
Contributor

@henrikstranneheim henrikstranneheim left a comment

Choose a reason for hiding this comment

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

Fantastic, 👍

genotype_api/database/models.py Show resolved Hide resolved
@@ -1,18 +1,19 @@
SQLAlchemy==1.4.30
SQLAlchemy
Copy link
Contributor

Choose a reason for hiding this comment

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

⭐ Nice

Copy link
Contributor

@islean islean left a comment

Choose a reason for hiding this comment

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

There is a subtlety (or at least I am quite certain there is) in that optionals have changed behaviour. Previously a: str | None would mean that you could instantiate the BaseModel without a set. That is not the case in Pydantic v2. The same behaviour would be achieved by a: str | None = None. Please double check if I am correct though.

edit: I was mistaken.

Copy link
Contributor

@islean islean left a comment

Choose a reason for hiding this comment

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

Nevermind, thought SQLModels extended BaseModels! Looks good!

Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
3.5% Duplication on New Code (required ≤ 3%)

See analysis details on SonarCloud

@ChrOertlin
Copy link
Contributor Author

This proves to be more of a hassle than I thought

@ChrOertlin
Copy link
Contributor Author

Closing, done in another PR

@ChrOertlin ChrOertlin closed this Apr 5, 2024
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