acoustic-carpenter-78188
08/07/2023, 6:23 PMparallel_task_with_default
over a list of inputs, where each element is passed to inp1
. inp2
should be a default input, equal for all parallel calls of the task.
@task
def parallel_task(inp: int) -> int:
return inp ** 2
@task
def parallel_task_with_default(inp1: int, inp2: int) -> int:
return inp1 ** 2 + inp2
@workflow
def square_workflow(inp1: List[int], inp2: int) -> None:
# Supported
out1 = map_task(parallel_task)(inp=inp1)
# Not supported!
out2 = map_task(parallel_task_with_default, inp2=inp2)(inp1=inp1)
Describe alternatives you've considered
A potential workaround is explained in the documentation.
Propose: Link/Inline OR Additional context
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
08/07/2023, 6:23 PM