Romain
04/29/2021, 9:21 AMfrom prefect import Flow, task, flatten, apply_map
@task
def A():
return [1, 2, 3]
@task
def B(x):
return list(range(x))
@task
def C(y):
return y + 100
def foo(y):
return C(y)
with Flow('flat map') as f:
a = A() # [1, 2, 3]
b = B.map(x=a) # [[0], [0, 1], [0, 1, 2]]
c = apply_map(foo, y=flatten(b)) # [100, 100, 101, 100, 101, 102]
While running it, I get : "TypeError: can only concatenate list (not "int") to list"
Am I missing something?Zach Angell
Romain
04/29/2021, 1:48 PMZach Angell
Marvin
04/29/2021, 1:54 PM