Skip to content

Commit

Permalink
fix(steps): better int parsing...
Browse files Browse the repository at this point in the history
needs to be able to parse a string to a float and then an int
  • Loading branch information
AntoineDao committed Dec 19, 2020
1 parent a017cdb commit 23354f8
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion queenbee/io/inputs/step.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ def from_template(template: Union[DAGInputs, FunctionInputs], value: Any) -> Ste
return StepStringInput.parse_obj(template_dict)

if template.__class__ in [DAGIntegerInput, FunctionIntegerInput]:
template_dict['value'] = int(template_dict['value'])
template_dict['value'] = int(float(template_dict['value']))
return StepIntegerInput.parse_obj(template_dict)

if template.__class__ in [DAGNumberInput, FunctionNumberInput]:
Expand Down
2 changes: 1 addition & 1 deletion queenbee/io/outputs/step.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ def from_template(template: Union[DAGOutputs, FunctionOutputs], value: Any) -> S
return StepStringOutput.parse_obj(template_dict)

if template.__class__ in [DAGIntegerOutput, FunctionIntegerOutput]:
template_dict['value'] = int(template_dict['value'])
template_dict['value'] = int(float(template_dict['value']))
return StepIntegerOutput.parse_obj(template_dict)

if template.__class__ in [DAGNumberOutput, FunctionNumberOutput]:
Expand Down

0 comments on commit 23354f8

Please sign in to comment.