Hey all, I feel like im missing something really simple
Copy code
@task(result=LocalResult(location="initial_data.prefect"))
def root_task():
return [1, 2, 3]
@task(result=LocalResult(location="{date:%A}/{task_name}.prefect"))
def downstream_task(x):
return [i * 10 for i in x]
def rating_model_backtest_workflow(opts: dict):
with Flow("local-results") as flow:
downstream_task(root_task)
flow.run()
I’m running this from the docs, I am expecting files to show up at
./initial_data.prefect
and the other location, but nothing appears, am I missing something obvious?
👀 1
Evan Curtin
08/26/2021, 3:43 PM
OH i think i got it with 2 changes:
• export PREFECT__FLOWS__CHECKPOINTING=true
• file is at
~/prefect/results/./test_root.prefect
which was rather surprising
k
Kevin Kho
08/26/2021, 3:50 PM
Glad you got this figured out. If you get a chance, could you move the log to the thread just to clear a bit more space in the main channel?
e
Evan Curtin
08/26/2021, 3:51 PM
sure:
Evan Curtin
08/26/2021, 3:51 PM
logs:
Copy code
[2021-08-26 10:33:36-0500] INFO - prefect.FlowRunner | Beginning Flow run for 'local-results'
[2021-08-26 10:33:36-0500] INFO - prefect.TaskRunner | Task 'root_task': Starting task run...
[2021-08-26 10:33:36-0500] INFO - prefect.TaskRunner | Task 'root_task': Finished task run for task with final state: 'Success'
[2021-08-26 10:33:36-0500] INFO - prefect.TaskRunner | Task 'downstream_task': Starting task run...
[2021-08-26 10:33:36-0500] INFO - prefect.TaskRunner | Task 'downstream_task': Finished task run for task with final state: 'Success'
[2021-08-26 10:33:36-0500] INFO - prefect.FlowRunner | Flow run SUCCESS: all reference tasks succeeded
k
Kevin Kho
08/26/2021, 3:53 PM
Thanks!
e
Evan Curtin
08/26/2021, 3:56 PM
is there a way to set this configuration directly in the workflow code without relying on environment var setup?
k
Kevin Kho
08/26/2021, 3:57 PM
If you end up running with Prefect Cloud or Prefect Server, the checkpointing env var will always be true. You can also explicitly state it on the task level
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.