ale
05/23/2022, 1:23 PMdict , but got the following error:
At least one upstream state has an unmappable result.
Looking at the docs, it seems that map should work with an Iterable .
Afaik, dict is an Iterable in Python, so I’m a bit confused 😅
I’m using Prefect 0.15.16Vadym Dytyniak
05/23/2022, 1:26 PMale
05/23/2022, 1:27 PMunmapped objectAnna Geller
emre
05/23/2022, 1:44 PMdict.items() isale
05/23/2022, 1:46 PMAnna Geller
list(your_dict.values())Anna Geller
Anna Geller
import prefect
from prefect import task, Flow
@task
def get_iterable():
sample_dict = dict(a=1, b=2, c=3)
return list(sample_dict.values())
# return sample_dict.values()
@task
def log_output(x):
<http://prefect.context.logger.info|prefect.context.logger.info>(x)
with Flow("map_dict_test") as flow:
iterable_input_from_dict = get_iterable()
log_output.map(iterable_input_from_dict)
if __name__ == "__main__":
flow.run()