-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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 generated config models #15212
Conversation
The |
Codecov Report
Flags with carried forward coverage won't be shown. Click here to find out more. |
96437d7
to
2542877
Compare
3aa4db3
to
1f39882
Compare
38f8627
to
15b10ee
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
docs-approved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great job!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thank you Ofek for the updates 👍
What does this PR do?
This upgrades our config model generation to use Pydantic v2
Motivation
Additional Notes
The major change is that now options are nullable and the ones that are not required will be
None
by default rather than the default value of its type. For example, an optional password field will beNone
rather than an empty string if unset.A few other things that are noteworthy about the migration:
= None
validate_default=True
on theConfigDict
object is what instructs validation to always run even for fields that are unset (allowing us to set defaults), rather than the oldalways=True
option on the decoratorsfrozen=True
on theConfigDict
object is what instructs the model to have best effort immutability, rather than the oldallow_mutation = False
check_
rather thanfinalize_
Warnings are emitted because of our transformation of mutable types into immutable types. This will be fixed in a subsequent PR.
Review checklist (to be filled by reviewers)
The changes exist only in the base package and in the developer package, the generated code itself is the reason for the large diff