https://prefect.io logo
Title
b

bardovv

03/18/2020, 6:50 PM
from prefect import Flow, task

@task
def add_ten(x):
    return x + 10

with Flow('simple map') as flow:
    mapped_result = add_ten.map([1, 2, 3])
I am using this code expected output is 11,12,13 in mapped_result how do I print the result?
c

Chris White

03/18/2020, 6:54 PM
Hi @bardovv - you can access the return values from the flow / task run states as follows:
flow_state = flow.run()
task_state = flow_state.result[mapped_result]

print(task_state.result) # the actual return payload
b

bardovv

03/18/2020, 6:55 PM
can you share me the link where it's mentioned in the docs?
I can't get a dynamic visualization without using prefect cloud right? Like in airflow of state changes?
c

Chris White

03/18/2020, 6:58 PM
Yea, a dynamic visualization requires a backend which is currently only available via Cloud; we do have a completely free tier though if you want to sign up here: https://cloud.prefect.io
b

bardovv

03/19/2020, 6:15 AM
I am happy with the prefect core, I wanted an open source version for the prefect cloud, why is it that prefect cloud has pricing? Why have you'll not kept the scheduler as part of the prefect core instead of putting it in the prefect cloud.