diff --git a/ui/sdk/src/hamilton_sdk/tracking/constants.py b/ui/sdk/src/hamilton_sdk/tracking/constants.py index da6f2e8cc..133f32576 100644 --- a/ui/sdk/src/hamilton_sdk/tracking/constants.py +++ b/ui/sdk/src/hamilton_sdk/tracking/constants.py @@ -45,21 +45,21 @@ def _load_config(config_location: str) -> configparser.ConfigParser: file_config = _load_config(DEFAULT_CONFIG_LOCATION) -def _convert_to_type(val: str) -> Any: - if not isinstance(val, str): # guard - return val - if val.isdigit(): +def _convert_to_type(val_: str) -> Any: + if not isinstance(val_, str): # guard + return val_ + if val_.isdigit(): # convert to int - val = int(val) - elif val.lower() in {"true", "false"}: + val_ = int(val_) + elif val_.lower() in {"true", "false"}: # convert to bool - val = val.lower() == "true" + val_ = val_.lower() == "true" else: try: # check if float - val = float(val) + val_ = float(val_) except ValueError: pass - return val + return val_ # loads from config file and overwrites