https://prefect.io logo
Title
b

Barada Sahu

09/07/2022, 8:20 AM
Is there a way to pass a
PrefectFuture
to a downstream task or does the task result always get evaluated and then passed as an argument?
1
m

Mason Menges

09/07/2022, 3:11 PM
Hey @Barada Sahu calling .submit() on a task creates a prefect future, you can check out more about this here https://docs.prefect.io/concepts/task-runners/?h=submit#using-results-from-submitted-tasks.
b

Barada Sahu

09/07/2022, 3:28 PM
@Mason Menges the downstream task is receiving the evaluated result of the , even though I pass a PrefectFuture (returned object from .submit()) as the argument to it . see below 👇
def test_flow(nums: list = None):
    test_futures = [square.submit(num) for num in nums]
    return do_cleanup.submit(test_futures)
do_cleanup
is receiving a list of returned values and not the futures