-
-
Notifications
You must be signed in to change notification settings - Fork 443
[Bugfix] Fix logic in setting settings using env vars. #6669
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
Conversation
for more information, see https://pre-commit.ci
I think this PR is the minimum to fix the bugged behavior which has annoyed me for some time.
For some more context, see my investigation here: |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #6669 +/- ##
==========================================
- Coverage 92.73% 92.66% -0.07%
==========================================
Files 610 610
Lines 55382 55404 +22
==========================================
- Hits 51357 51341 -16
- Misses 4025 4063 +38 ☔ View full report in Codecov by Sentry. |
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.
I have downloaded it and it works. I think that I understand and agree with patches, but I think that in general code should be refactored and splitted on more functions.
But I'm ok with merge it.
So @psobolewskiPhD if you do not have time to refactor code, the add ready to merge
label.
I suspect that the handling could be largely replaced with pydantic stuffs, because that now supports this kind of stuff, which it didn't when this code was written. However, I might be missing some nuance and I hesitate to volunteer for this job 😬 Any thoughts on my questions #6669 (comment) |
This looks close to ready so I'm marking it for the spiffy new 0.5.1 milestone. Code refactors can come later. |
References and relevant issues
Closes: #6637
Description
This PR fixes the logic in the
nested_env_settings
method to:I added tests that fail on
main
, plus a sub-cases that passes on main but wasn't tested.Edit: berg, the diff is annoying.
The first change is just indenting all the logic under
for subf in field_type.__fields__.values():
The 2nd change is removing the early break in the
else
offor e in subf.field_info.extra.get('env_names', []):
. This break in the for loop else was breaking the parent loop early.