Frank Embleton
05/15/2022, 11:38 AMReturn a future
If a flow returns one or more futures, the final state is determined based on the underlying states.
```from prefect import task, flow
@task
def always_fails_task():
raise ValueError("I am bad task")
@task
def always_succeeds_task():
return "foo"
@flow
def always_succeeds_flow():
x = always_fails_task()
y = always_succeeds_task()
return y```What does it mean by futures here? My understanding was that futures are to do with threading and async in Python, of which I see neither here? What am I missing? 🤔
Anna Geller
05/15/2022, 12:00 PM>>> @flow
>>> def my_flow():
>>> future = my_task() # PrefectFuture[str, Sync] includes result type
>>> future.run_id # UUID for the task run
Frank Embleton
05/15/2022, 12:07 PM