Hi team, is there a way in Kedro to conditionally ...
# questions
s
Hi team, is there a way in Kedro to conditionally stop certain downstream nodes from running based on the output of a specific node using hooks or any other Kedro setup? For example, if I have five nodes (A, B, C, D, E), I want to check whether the output of node B is empty. If it's empty, I want to skip nodes C, D, and E. Otherwise, all nodes should run as usual
h
Someone will reply to you shortly. In the meantime, this might help:
l
Check out the hooks
before_node_run
and
after_node_run
. Maybe you could use them to check the outpute of one of the nodes after it runs and then decide if the next ones should run or not. https://docs.kedro.org/en/stable/hooks/introduction.html
s
Thankyou for sharing this. I'll let you know if it works
I used a simple hook implementation to exit out of the kedro run if a certain condition is satisfied