Skip to content

Commit

Permalink
Bugfix default 0 values (#304)
Browse files Browse the repository at this point in the history
Fixes default values set at `0` that were wrongly evaluated to `None`
  • Loading branch information
PhilippeMoussalli authored Jul 18, 2023
1 parent 6d2251e commit 551f7b1
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/fondant/executor.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ def _add_and_parse_args(cls, spec: ComponentSpec):
if arg.name in cls.optional_fondant_arguments():
input_required = False
default = None
elif arg.default:
elif arg.default is not None:
input_required = False
default = arg.default
else:
Expand Down
2 changes: 1 addition & 1 deletion tests/example_specs/components/arguments/component.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ args:
integer_default_arg:
description: default integer argument
type: int
default: 1
default: 0
float_default_arg:
description: default float argument
type: float
Expand Down
2 changes: 1 addition & 1 deletion tests/test_component.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ def _process_dataset(self, manifest: Manifest) -> t.Union[None, dd.DataFrame]:
executor = MyExecutor.from_args()
assert executor.user_arguments == {
"string_default_arg": "foo",
"integer_default_arg": 1,
"integer_default_arg": 0,
"float_default_arg": 3.14,
"bool_false_default_arg": False,
"bool_true_default_arg": True,
Expand Down

0 comments on commit 551f7b1

Please sign in to comment.