Hello! I have a small data project at work that I...
# prefect-community
d
Hello! I have a small data project at work that I would like to use with prefect. I have a scenario that I am trying to find in the prefect documentation, but having a hard time finding it. Basically, let's say I have 5 tasks that need to be executed and let's say failure occurs with task 3. After fixing the problem with task 3, I want to re-run the script, but not have it execute tasks 1 and 2 again. I looked at "Handling Failure" page (https://docs.prefect.io/core/tutorial/04-handling-failure.html), but it seems like the scenarios it listed are for what to do with the current runtime execution, but not for post-runtime execution. I also looked at documentation on persisting task results and checkpointing, seems like this is where it might be related to my scenario, but not sure. Can someone point me to a concrete example or page in the documentation that addresses the scenario that I presented? Thanks in advance!
z
Hi @Daniel Kim! There are a couple of ways you could address this! The first is running with targets, which would let you use cached results to prevent reruns for your successful tasks. In your case, results for tasks 1 and 2 would be cached, allowing you to just rerun task 3. The second approach is a WIP feature we’re calling “hot reloading.” This would let you tweak the code for task 3 without requiring you to reregister an entirely new flow. Details forthcoming on that— watch this space! https://docs.prefect.io/core/idioms/targets.html#using-result-targets-for-efficient-caching
d
Thanks @Zachary Hughes!