https://prefect.io logo
Title
d

Dan Marling

12/14/2022, 4:52 PM
Prefect 2.0 question here - I have three scripts I want to orchestrate in a flow by utilizing the ’shell_run_command” and passing in the command to execute a script. The scripts are not idempotent, and I’d like to cache their completed status if there is a failure between the scripts. Shell_run_command is a ‘task’ object type, and I cannot call a task from within a task to utilize the task cache key. What should I be doing instead?
s

scott

12/14/2022, 4:54 PM
z

Zanie

12/14/2022, 4:54 PM
I’m not sure I follow why you can’t set a cache key
d

Dan Marling

12/14/2022, 4:56 PM
I do not see a place to provide the shell_run_command a cache key
z

Zanie

12/14/2022, 4:57 PM
shell_run_command.with_options(cache_key_fn=…)
d

Dan Marling

12/14/2022, 4:58 PM
ooo I did not find ‘with_options’ . I will try it out
z

Zanie

12/14/2022, 4:59 PM
cc @terrence we may want to highlight
with_options
in the documentation
👍 1
@alex it’d. be good to highlight
with_options
in collections documentation especially, since they are “preconfigured”
👍 1
t

terrence

12/14/2022, 5:08 PM
This is on my roadmap. Thanks for the heads up. I’ll try to move it up the priority ladder
d

Dan Marling

12/14/2022, 5:19 PM
okay I got it working 🙂
👍 1