Jonah Benton
08/23/2019, 12:54 AMJeremiah
input_list
gets passed to the second copy of task1
, then reduced into results1
(a list of all results). task2
then maps over that list, such that the second copy of task2
gets only the result produced by the second copy of task1
.Jeremiah
Jeremiah
from prefect import task, Flow
@task
def plus_1(x):
print('received {}'.format(x))
print('returning {}'.format(x + 1))
return x + 1
with Flow('iterated mapping') as flow:
input = [1, 2, 3]
result1 = plus_1.map(input)
result2 = plus_1.map(result1)
result3 = plus_1.map(result2)
flow.run()
Jonah Benton
08/23/2019, 1:01 AMJonah Benton
08/23/2019, 1:01 AMJonah Benton
08/23/2019, 1:02 AMJeremiah
Jonah Benton
08/23/2019, 1:03 AMJeremiah
Jeremiah
Jeremiah
Jonah Benton
08/23/2019, 1:07 AMJeremiah