Hello team,
Is there a bug in "apply_map" working with flatten? I tried to modify the example from the doc (
https://docs.prefect.io/core/concepts/mapping.html#flat-mapping) to use apply_map:
from 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?