Prefect 2 - Task returns 2 results

Hi friends,
In Prefect 1 there was a argument in the task decorator called “nout”. If my function returns 2 results I could use “nout=2”.
How can do the same thing in Prefect 2?

I am trying to do something like this:

@task()
def function_2_returns():
	do_something_here

	return datrafame_1, dataframe


@flow(name="my_super_flow")
def my_super_flow():
    datrafame_1, dataframe_2 = function_2_returns()  # This returns 2 dataframes
    store_data_into_db(datrafame_1)
    store_data_into_db(datrafame_2)
1 Like

There is currently no tuple unpacking afaik, but you could solve it by returning a list of objects and accessing those in a downstream task

if this is not suitable for your work, feel free to open a feature request on GitHub, this way, it’s on a backlog