Is there a simple method of grabbing a property of an object returned by a task to pass as the input to a downstream task, without having a task explicitly to just pull out that property? E.g.
Copy code
@task
def task1():
return Object(foo='bar')
@task
def task2(foo: str):
// Do something
@task
def getfoo(o: Object):
return o.foo
with Flow('my-flow'):
task1_result = task1()
// This fails
task2(task1_result.foo)
// This works, but is annoying
task2(getfoo(task1_result))
k
Kevin Kho
12/24/2021, 11:34 PM
I think this is a limitation of the design of current Prefect Core because the Flow block is not deferred and constructs the graph. The
task1_result()
is still a Task here and it only resolves during Flow execution to the object. I think this should be doable in Prefect Orion (Prefect 2.0)
Bring your towel and join one of the fastest growing data communities. Welcome to our second-generation open source orchestration platform, a completely rethought approach to dataflow automation.