0

How can I tell Prefect, to not rerun all previous tasks in DAG?

v.sheg
  • 53
  • 4

1 Answers1

0

Targets will get you where you want to go. From the docs:

Targets in Prefect are templatable location strings that are used to check for the existence of a task Result. This is useful in cases where you might want a task to only write data to a location once or merely not rerun if some piece of data is present. If a result exists at that location then the task run will enter a cached state.

In your task decorator just add a target like so:

@task(result=LocalResult(), target="{task_name}-{today}")