Kingsley Blatter12/04/2020, 11:01 PM
This would cause an error, because Prefect has no way of knowing how many values your task returns (because it has not been run yet!). @Jim Crist-Harif crafted an elegant solution that allows you to specify the number of return values so that you can continue using familiar Python syntax.
@task def return_two_things(): return 1, 2 with Flow("example") as flow: one, two = return_two_things # this raises an error
Thank you to you the community that continues to provide feedback, so that we can continue to add enhancements such as these once we have had the chance to observe and choose the best way to provide a solution. For more details, please see the link here. In addition, this may look more like a 💡spotlight💡on @Jim Crist-Harif but he as just published a new deployment tutorial guide, perfect for anyone getting started or more seasoned users wanting to read about our new flow configuration. The link can be found here.
@task(nout=2) def return_two_things(): return 1, 2 with Flow("example") as flow: one, two = return_two_things # this now works!