Lana Dann
05/04/2022, 7:23 PMflow.<method name>(<method arguments>)
doesn’t work, so i assume we’d need to grab the task from flow.tasks
and then run the task object.
so my follow up question would be, what is the best way to retrieve a task by name from a Flow
object?Kevin Kho
from prefect import Flow, task
@task
def abc(x):
return x
@task
def bcd(x):
return x
with Flow("..") as flow:
a = abc(1)
b = bcd(1)
print(flow.tasks)
print(list(flow.tasks)[0].name)
And then find the one with the name you want? But I think you can just test the task directly?Lana Dann
05/04/2022, 8:02 PM@task
def abc(x):
return x
and you import from myflow import abc
then is that a task object or just a method?Kevin Kho
abc.run()