Klemens Kasseroller
08/21/2023, 2:59 PM@task
def demo_task(strings: List[str], num: int) -> str:
return f"{num}".join(strings)
@workflow
def demo_wf(strings: List[str], nums: List[int]) -> None:
map_task(functools.partial(demo_task, strings=strings))(num=nums)
According to the docs, lists are not allowed as input of a partial, therefore I would expect this to crash at compilation or during runtime. Weirdly, this does compile fine and even works, if the length of both lists is equal. If the input of the above example is a,b,c and 1,2,3, the output looks like the following:
["a1b1c","a2b2c","a3b3c"]
which is what I would expect. If the length of the two arrays is different, however, the task fails with input arrays have different lengths: expecting 'x' found 'x'
I cannot really see, why the lenght of these lists wouls have to be equal.
Tested with both array node map_task and k8s array map_task.Dan Rammer (hamersaw)
08/21/2023, 3:12 PMKlemens Kasseroller
08/22/2023, 6:17 AMKetan (kumare3)
Klemens Kasseroller
10/30/2023, 3:49 PM