https://prefect.io logo
Title
m

Michael Law

09/09/2022, 8:05 AM
Hey guys, I might be missing something in v2, but in v1 I belive we can re-run just the failed tasks from a flow run, can we do the same in v2?
šŸ‘€ 1
āœ… 1
https://discourse.prefect.io/t/how-can-i-restart-a-flow-in-prefect-2-0/1332/8 Im guessing this still stands, so re-runnin only failed tasks won't be possible on a flow?
Possibly once sub-flows have the better method of dynamically chaining this might not be an issue, but does feel like a substatial regression from v1 where I believe this is possible to do
r

Rob Freedy

09/09/2022, 6:55 PM
You are correct that re-running only failed tasks is not currently supported. I would recommend implementing caching on your tasks, which can accomplish similar behavior https://docs.prefect.io/concepts/tasks/?h=caching#caching
m

Michael Law

09/12/2022, 9:55 AM
@Rob Freedy Iā€™m not sure if this is the correct you link were supposed to point me towards for caching?
@Anna Geller @Rob Freedy In regards to caching, do FAILED state tasks get cached? Also, are tasks cached from time of completion of the overall flow or from when the task was executed?
r

Rob Freedy

09/12/2022, 12:46 PM
@Michael Law Apologies on the incorrect link! From the above (correct) link: "When each task run requested to enter a
Running
state, it provided its cache key computed from the
cache_key_fn
. The Orion backend identified that there was a COMPLETED state associated with this key and instructed the run to immediately enter the same COMPLETED state, including the same return values."
m

Michael Law

09/12/2022, 2:34 PM
Nice one, thanks. Does this also imply that if it enters a state FAILED, it does not get cached?