Hi...I need help printing task results using Prefe...
# prefect-community
s
Hi...I need help printing task results using Prefect 1: seems like printing the output only prints the task name, not task result:
Copy code
from prefect import task, Flow

@task
def get_value():
    return 10

with Flow("task-results") as flow:
    v = get_value()
    print(v)

state = flow.run()
I get
<Task: get_value>
instead of
10
. What am I doing wrong?
1
z
In the
with Flow
block you are declaring your DAG, not running the flow. If you move your print value to a task, it’ll execute at runtime.
s
Gotcha...thanks Michael. I'll give that a shot.