Sanjay Patel
06/09/2020, 1:30 AMnicholas
output.result[<task_ref>].result
where <task_ref>
is the reference to the task you defined in your flow.
In a simple flow:
import prefect
from prefect import Flow, task
@task
def my_task()
return [1, 2, 3]
with Flow("my-flow") as flow:
my_task_result = my_task()
output = flow.run()
# this is the result of my_task
output.result[my_task_result].result
Sanjay Patel
06/09/2020, 1:53 AMmy_task_result
, all I have saved is the flow
and I run it in a different location. Is it possible to access the my_task_result
from the flow
object without it having been run?
2. Which may become clearer after #1 but I'm also using my_task.mapped() so I have an arraynicholas
for ref in flow.get_tasks():
print(output.result[ref].result)
and then further filter out the results you don't wantSanjay Patel
06/09/2020, 3:08 AMnicholas