Skip to content

Commit

Permalink
WIP: Better handle loading of configuration parameter types
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastientourbier committed Feb 26, 2021
1 parent fc6f6e7 commit fb9b722
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions cmtklib/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -415,7 +415,8 @@ def set_pipeline_attributes_from_config(pipeline, config, debug=True):
conf_value = bool(conf_value)
elif isinstance(getattr(sub_config, sub_key), list):
conf_value = eval(conf_value)
elif isinstance(getattr(stage.config, key), str):

if isinstance(getattr(stage.config, key), str):
if conf_value.isnumeric():
if isinstance(getattr(sub_config, sub_key), int):
conf_value = Int(conf_value)
Expand Down Expand Up @@ -445,7 +446,8 @@ def set_pipeline_attributes_from_config(pipeline, config, debug=True):
conf_value = bool(conf_value)
elif isinstance(getattr(stage.config, key), list):
conf_value = eval(conf_value)
elif isinstance(getattr(stage.config, key), str):

if isinstance(getattr(stage.config, key), str):
if conf_value.isnumeric():
if isinstance(getattr(stage.config, key), int):
conf_value = Int(conf_value)
Expand Down

0 comments on commit fb9b722

Please sign in to comment.