Hi team, I’m looking for a programmatic way to rer...
# questions
a
Hi team, I’m looking for a programmatic way to rerun the failed nodes in a kedro pipeline. The kedro pipeline is triggered by airflow from the outside. So we were taking the approach of using kedro-airflow plugin and do the node/task retry by passing an argument. Looking for ways to do it without the plugin. Any help/pointers? Thanks in advance
i
Maybe hooks are helpful: •
on_node_error
here
on_pipeline_error
here
👍 1
a
How do you want to get the failed pipeline and the specific node Can you tell more about it?
a
hi @Ian Whalen and kedro team 🙂 to the point above - if I catch the pipeline failure in
on_pipeline_error
, can I re-start the pipeline?
the goal is - I want to automate re-starting the pipeline from the failure point...
i
I’ll paste what I DM’d Amala here:
Good question! I’ve never actually done it
Looking at the inputs for
on_node_error
it doesn’t look like you’d actually be able to rerun it easily
For
on_pipeline_error
seems like you’d be able to rerun but honestly it doesn’t seem like either node is really meant for that…
Inside on pipeline error you could do something like what happens in the main file
But you’d also have to figure out what node errored out somehow…
really not sure sorry 😞
might be easier to parse the log output of the pipeline failure and run that
Overall, I’m not sure that this is really what those hooks are for… its kind of getting into the orchestration world To add some color on the last point, when a pipeline errors you’ll get something like
Copy code
You can resume the pipeline run from the nearest nodes with persisted inputs by adding the following argument to your previous command:
  --from-nodes "..."
Maybe it would be best to just parse that output from the logs and try to rerun from an orchestrator instead? Seems a little hacky but probably more correct I’m no expert here though