-
-
Notifications
You must be signed in to change notification settings - Fork 304
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
main: fix configuration model validation after CLI args merge #1448
Conversation
Signed-off-by: Etienne Wodey <etienne.wodey@aqt.eu>
@airwoodix |
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## master #1448 +/- ##
===========================================
Coverage 100.00% 100.00%
===========================================
Files 11 32 +21
Lines 1020 3563 +2543
Branches 201 838 +637
===========================================
+ Hits 1020 3563 +2543
Flags with carried forward coverage won't be shown. Click here to find out more.
☔ View full report in Codecov by Sentry. |
for more information, see https://pre-commit.ci
The bug reported in #1435 seems to originate in the
Config._validate_base_class
method: in Pydantic v2,@model_validator(mode="after")
decorates an instance method instead of a class method that receives the raw values (the case formode="before"
). Therefore, except when called to alterset_args
inConfig.merge_args
, thevalues
argument is of typeConfig
and"base_class" not in values
is always true.This MR is an attempt at fixing the issue, for Pydantic v2 only for the moment.
TODOS:
Closes #1435.