white-teacher-47376
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.hallowed-mouse-14616
08/21/2023, 3:12 PMhallowed-mouse-14616
08/21/2023, 3:12 PMwhite-teacher-47376
08/22/2023, 6:17 AMwhite-teacher-47376
10/27/2023, 9:11 AMfreezing-airport-6809
white-teacher-47376
10/30/2023, 3:49 PM