put the field type *before* not after
This commit is contained in:
parent
3736844b30
commit
e38a85ae75
@ -188,9 +188,6 @@ def interpret_path_env(value: str) -> Path:
|
||||
|
||||
Returns:
|
||||
The interpreted value.
|
||||
|
||||
Raises:
|
||||
ValueError: If the value is invalid.
|
||||
"""
|
||||
return Path(value)
|
||||
|
||||
@ -260,14 +257,14 @@ class EnvironmentVariables:
|
||||
for field in dataclasses.fields(self):
|
||||
raw_value = os.getenv(field.name, None)
|
||||
|
||||
field.type = type_hints[field.name] or field.type
|
||||
|
||||
value = (
|
||||
interpret_env_var_value(raw_value, field)
|
||||
if raw_value is not None
|
||||
else get_default_value_for_field(field)
|
||||
)
|
||||
|
||||
field.type = type_hints[field.name] or field.type
|
||||
|
||||
setattr(self, field.name, value)
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user