antony.milne
02/02/2022, 10:13 AMbefore_pipeline_run
, after_pipeline_run
, on_pipeline_error
) have both run_params
and pipeline
available to them as arguments. Hence you could do a conditional hook like this:
class Hooks:
@hook_impl
def before_pipeline_run(self, run_params: Dict[str, Any]) -> None:
if run_params["pipeline_name"] == "data_science":
# code that only runs when you call `kedro run --pipeline=data_science`
Alternatively you can use pipeline
which will contain the actual Pipeline
object (i.e. collection of nodes) that kedro is going to execute in that kedro run