Implement proper support for nested complex env values#22
Conversation
Co-authored-by: Hasan Ramezani <hasan.r67@gmail.com>
Codecov ReportPatch coverage:
📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more Additional details and impacted files@@ Coverage Diff @@
## main #22 +/- ##
==========================================
+ Coverage 95.61% 95.91% +0.29%
==========================================
Files 5 5
Lines 251 269 +18
Branches 60 66 +6
==========================================
+ Hits 240 258 +18
Misses 10 10
Partials 1 1
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report in Codecov by Sentry. |
samuelcolvin
left a comment
There was a problem hiding this comment.
otherwise I think looks good, but I'm a bit unclear how this works, will be easier to review when next_field has a docstring.
|
|
||
| @staticmethod | ||
| def next_field(field: Optional[FieldInfo], key: str) -> Optional[FieldInfo]: | ||
| if not field or origin_is_union(get_origin(field.annotation)): |
| # check if env_val maps to a complex field and if so, parse the env_val | ||
| if target_field and env_val: | ||
| is_complex, allow_json_failure = self._field_is_complex(target_field) | ||
| if is_complex: |
There was a problem hiding this comment.
do we have a way to disable json parsing?
There was a problem hiding this comment.
I've tried to disable it here but it doesn't work
I haven't looked deeply on it but seems we need it here
|
thanks. |
Port pydantic/pydantic#4216