acoustic-carpenter-78188
11/30/2023, 7:27 PM@workflow
def my_sub_wf(a: int, b: int = 5) -> int:
return t1(a=a, b=b)
lp = launch_plan.LaunchPlan.get_or_create(my_sub_wf)
If I call lp(a=1)
that will work as expected using the default parameter for b
.
However this does not work
@workflow
def my_wf(a: int) -> int:
return lp(a=a)
my_wf(a=8)
E flytekit.exceptions.user.FlyteAssertion: Error encountered while executing 'my_wf':
E Input b of type <class 'int'> was not specified for function tests.flytekit.unit.core.test_launch_plan.my_sub_wf
Expected behavior
The default paramater for b
should be used and the workflow should work.
Additional context to reproduce
def test_lp_default_paramaters_work_when_called_from_another_workflow():
@task
def t1(a: int, b: int) -> int:
return a + b
@workflow
def my_sub_wf(a: int, b: int = 5) -> int:
return t1(a=a, b=b)
lp = launch_plan.LaunchPlan.get_or_create(my_sub_wf)
@workflow
def my_wf(a: int) -> int:
return lp(a=a)
my_wf(a=8)
I will make a PR for flytekit
which resolves the problem and adds this test.
Screenshots
No response
Are you sure this issue hasn't been raised already?
☑︎ Yes
Have you read the Code of Conduct?
☑︎ Yes
flyteorg/flyteacoustic-carpenter-78188
11/30/2023, 7:27 PM