https://prefect.io logo
Title
m

Mohamed Ayoub Chettouh

08/08/2022, 2:47 PM
Hi, How to deal with tasks which output multiple outputs. Currently, it seems if I use those outputs as inputs elsewhere Prefect won't detect the dependency.
k

Khuyen Tran

08/08/2022, 2:49 PM
Which version of Prefect are you using?
m

Mohamed Ayoub Chettouh

08/08/2022, 2:51 PM
2.0.3
j

Jeff Hale

08/08/2022, 3:08 PM
Are you able to provide a code example?
m

Mohamed Ayoub Chettouh

08/08/2022, 3:09 PM
For example read two csv dataframes with pandas with the first task, and pass the dataframes to a preprocessor.
k

Khuyen Tran

08/08/2022, 3:40 PM
This is a side effect after the change in 2.0 (returning a Python object instead of Prefect Future) and we are working on fixing this. For now, I suggest that you return a dictionary or a list instead of multiple outputs:
{'val1': 1, 'val2': 2}
👍 1