question about `shell_run_command` in orion. I’m n...
# prefect-community
b
question about
shell_run_command
in orion. I’m not able to pass a
retries
parameter to the task.
TypeError: got an unexpected keyword argument 'retries'
any ideas?
Copy code
config_ssh_rsync_f = shell_run_command(
        retries = 3, 
        retry_delay_seconds = 10, 
        command = "ls", 
        return_all = True, 
        wait_for = [spinup_databox_f], 
    )
the above is inside my @flow function of course
a
try this syntax:
Copy code
from prefect import flow
from prefect_shell import shell_run_command


@flow
def example_shell_run_command_flow():
    return shell_run_command.with_options(retries=5)(command="ls .", return_all=True)


if __name__ == "__main__":
    example_shell_run_command_flow()
or with more task-args like delay:
Copy code
from prefect import flow
from prefect_shell import shell_run_command


@flow
def example_shell_run_command_flow():
    return shell_run_command.with_options(retries=5, retry_delay_seconds=30)(
        command="ls .", return_all=True
    )


if __name__ == "__main__":
    example_shell_run_command_flow()
b
thanks for the magic syntax -that worked
👍 1