Skip to content

Commit

Permalink
Fixed boolean parameters not recognized properly as booleans: paramet…
Browse files Browse the repository at this point in the history
…ers detect_year_range and use_virtual_flows was always interpreted as False.
  • Loading branch information
jjarvik committed Sep 12, 2024
1 parent dac2bd5 commit 0f2c1a4
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions core/dataprovider.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ def __init__(self, filename: str = "",
found_param_value = self._to_bool(found_param_value)
param_value = param_type(found_param_value)
self._param_name_to_value[param_name] = param_value

except ValueError as e:
print("Invalid type for required parameter '{}': expected {}, got {}".format(
param_name, param_type_to_str[param_type], param_type_to_str[found_param_type]))
Expand Down Expand Up @@ -309,6 +310,9 @@ def _to_bool(self, value: Any) -> bool:
if value.lower() == "true":
return True

if isinstance(value, bool):
return value

else:
return False

Expand Down

0 comments on commit 0f2c1a4

Please sign in to comment.