Just wondered what I should be using instead :thum...
# prefect-community
Just wondered what I should be using instead 👍
I would go with something like this:
Copy code
# 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
upvote 3
Otherwise, you can print from the Task itself using
Copy code
def extract(log_stdout=True):
    # download and return a list of all texas realtors
    return result
upvote 4
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)
Oh okay I've got it. Basically there is a build time in the flow which creates the DAG.
But then all of the variables are actually executed after the flow has been run 👍
yup, exactly!
👍 1
I'm feeling the flow 🙂
marvin 2