Version: `prefect==2.0b12` Problem: when I run the...
# best-practices
k
Version:
prefect==2.0b12
Problem: when I run the code
a, b= task.submit(c, d)
the error occurs:`cannot unpack non-iterable PrefectFuture object` I can use
task(nout=2)
in Prefect 1.0+ when my task has multiple return values. What shall I do in Prefect 2.0+ in the same situation? Maybe
a, b= task.submit(c, d).result()
can work but I think it is not a good way.
1
a
Try returning a list of objects instead We don't do tuple unpacking when submitting to task runner However, if you run the task without .submit() i.e. running it in the main flow run process without task runners, then you should be able to do
Copy code
a, b = task()
as it returns data rather than future