kedro.framework.hooks.specs.PipelineSpecs

class kedro.framework.hooks.specs.PipelineSpecs[source]

Bases: object

Namespace that defines all specifications for a pipeline’s lifecycle hooks.

Methods

PipelineSpecs.after_pipeline_run(run_params, …) Hook to be invoked after a pipeline runs.
PipelineSpecs.before_pipeline_run(…) Hook to be invoked before a pipeline runs.
PipelineSpecs.on_pipeline_error(error, …) Hook to be invoked if a pipeline run throws an uncaught Exception.
__init__

Initialize self. See help(type(self)) for accurate signature.

after_pipeline_run(run_params, pipeline, catalog)[source]

Hook to be invoked after a pipeline runs.

Parameters:
  • run_params (Dict[str, Any]) –

    The params used to run the pipeline. Should be identical to the data logged by Journal with the following schema:

    {
      "run_id": str
      "project_path": str,
      "env": str,
      "kedro_version": str,
      "tags": Optional[List[str]],
      "from_nodes": Optional[List[str]],
      "to_nodes": Optional[List[str]],
      "node_names": Optional[List[str]],
      "from_inputs": Optional[List[str]],
      "load_versions": Optional[List[str]],
      "pipeline_name": str,
      "extra_params": Optional[Dict[str, Any]]
    }
    
  • pipeline (Pipeline) – The Pipeline that was run.
  • catalog (DataCatalog) – The DataCatalog used during the run.
Return type:

None

before_pipeline_run(run_params, pipeline, catalog)[source]

Hook to be invoked before a pipeline runs.

Parameters:
  • run_params (Dict[str, Any]) –

    The params used to run the pipeline. Should be identical to the data logged by Journal with the following schema:

    {
      "run_id": str
      "project_path": str,
      "env": str,
      "kedro_version": str,
      "tags": Optional[List[str]],
      "from_nodes": Optional[List[str]],
      "to_nodes": Optional[List[str]],
      "node_names": Optional[List[str]],
      "from_inputs": Optional[List[str]],
      "load_versions": Optional[List[str]],
      "pipeline_name": str,
      "extra_params": Optional[Dict[str, Any]]
    }
    
  • pipeline (Pipeline) – The Pipeline that will be run.
  • catalog (DataCatalog) – The DataCatalog to be used during the run.
Return type:

None

on_pipeline_error(error, run_params, pipeline, catalog)[source]

Hook to be invoked if a pipeline run throws an uncaught Exception. The signature of this error hook should match the signature of before_pipeline_run along with the error that was raised.

Parameters:
  • error (Exception) – The uncaught exception thrown during the pipeline run.
  • run_params (Dict[str, Any]) –

    The params used to run the pipeline. Should be identical to the data logged by Journal with the following schema:

    {
      "run_id": str
      "project_path": str,
      "env": str,
      "kedro_version": str,
      "tags": Optional[List[str]],
      "from_nodes": Optional[List[str]],
      "to_nodes": Optional[List[str]],
      "node_names": Optional[List[str]],
      "from_inputs": Optional[List[str]],
      "load_versions": Optional[List[str]],
      "pipeline_name": str,
      "extra_params": Optional[Dict[str, Any]]
    }
    
  • pipeline (Pipeline) – The Pipeline that will was run.
  • catalog (DataCatalog) – The DataCatalog used during the run.