Robin
10/19/2020, 4:15 PMJim Crist-Harif
10/19/2020, 4:25 PMRobin
10/19/2020, 4:52 PMreduce_list = task(lambda list_of_lists: reduce(list.extend, list_of_lists, []))
@task
def reduce_list(list_of_lists):
out = []
for l in list_of_lists:
out.extend(l)
return out
did the trick 🙂Jim Crist-Harif
10/19/2020, 8:38 PMprefect.flatten
, which will do that for you (but potentially in a more efficient way).
your_task.map(flatten(list_of_lists))
See https://docs.prefect.io/core/concepts/mapping.html#flat-mapping for more info.Robin
10/19/2020, 9:06 PM