# define Prefect flow
with Flow("Test Flow", schedule=schedule) as flow:
realtor_data = extract()
houston_realtor_data = transform()
load_to_database = load()
flow_state = flow.run()
result = flow_state.result[houston_realtor_data].result
print(result)
upvote 3
Raphaël Riel
10/22/2020, 5:15 PM
Otherwise, you can print from the Task itself using
log_stdout=True
.
Copy code
@task
def extract(log_stdout=True):
# download and return a list of all texas realtors
print(result)
return result
upvote 4
c
Chris White
10/22/2020, 5:33 PM
Hi @James Phoenix +1 to Raphael’s answer; for more context, remember that Prefect is built on a deferred execution model, which means that task results are not available until run time, but your print statement is executing at build time before any results are available. Something worth keeping in mind, as it can be a common stumbling block! (For another example, check out: https://stackoverflow.com/questions/64155793/is-it-possible-to-loop-over-a-prefect-parameter)
j
James Phoenix
10/22/2020, 5:41 PM
Oh okay I've got it.
Basically there is a build time in the flow which creates the DAG.
James Phoenix
10/22/2020, 5:41 PM
But then all of the variables are actually executed after the flow has been run 👍
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.