<#4444 [BUG] Launchplan default paramaters don't w...
# flytekit
a
#4444 [BUG] Launchplan default paramaters don't work when launched from another workflow Issue created by Tom-Newton Describe the bug Consider a launchplan created like this:
Copy code
@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
Copy code
@workflow
    def my_wf(a: int) -> int:
        return lp(a=a)

    my_wf(a=8)
Copy code
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
Copy code
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/flyte