<#5727 [BUG] Muilt-input map task accept list inpu...
# flytekit
c
#5727 [BUG] Muilt-input map task accept list input if it is the default argument Issue created by dansola ### Describe the bug Currently Flyte does not support partial task with lists as inputs. e.g.
Copy code
@task
def mult_sum(my_val: int, my_list: list[int]) -> int:
    return sum(my_val * v for v in my_list)


@workflow
def wf() -> list[int]:
    my_list = [1, 2, 3]
    my_vals = [1, 2]
    partial_task = functools.partial(mult_sum, my_list=my_list)
    return map_task(partial_task)(my_val=my_vals)
Copy code
ValueError: Cannot use a partial task with lists as inputs
However if
my_list
is a default workflow argument like so:
Copy code
@workflow
def wf(my_list: list[int] = [1, 2, 3]) -> list[int]:
    my_vals = [1, 2]
    partial_task = functools.partial(mult_sum, my_list=my_list)
    return map_task(partial_task)(my_val=my_vals)
No error is shown - in fact it works correctly when you run locally. When you run remotely you get a somewhat ambiguous error without a traceback"
Copy code
input arrays have different lengths: expecting '3' found '2'
### Expected behavior Ideally it would be nice to support partial task with lists as inputs, but if not, it would be great to have a similar compile time/local runtime error
ValueError
saying that
Cannot use a partial task with lists as inputs
. ### Additional context to reproduce No response ### Screenshots No response ### Are you sure this issue hasn't been raised already? • Yes ### Have you read the Code of Conduct? • Yes flyteorg/flyte