kedro.framework.hooks.specs.NodeSpecs¶
-
class
kedro.framework.hooks.specs.NodeSpecs[source]¶ Bases:
objectNamespace that defines all specifications for a node’s lifecycle hooks.
Methods
NodeSpecs.after_node_run(node, catalog, …)Hook to be invoked after a node runs. NodeSpecs.before_node_run(node, catalog, …)Hook to be invoked before a node runs. NodeSpecs.on_node_error(error, node, …)Hook to be invoked if a node run throws an uncaught error. -
__init__¶ Initialize self. See help(type(self)) for accurate signature.
-
after_node_run(node, catalog, inputs, outputs, is_async, run_id)[source]¶ Hook to be invoked after a node runs. The arguments received are the same as those used by
kedro.runner.run_nodeas well as theoutputsof the node run.Parameters: - node (
Node) – TheNodethat ran. - catalog (
DataCatalog) – ADataCatalogcontaining the node’s inputs and outputs. - inputs (
Dict[str,Any]) – The dictionary of inputs dataset. The keys are dataset names and the values are the actual loaded input data, not the dataset instance. - outputs (
Dict[str,Any]) – The dictionary of outputs dataset. The keys are dataset names and the values are the actual computed output data, not the dataset instance. - is_async (
bool) – Whether the node was run inasyncmode. - run_id (
str) – The id of the run.
Return type: None- node (
-
before_node_run(node, catalog, inputs, is_async, run_id)[source]¶ Hook to be invoked before a node runs. The arguments received are the same as those used by
kedro.runner.run_nodeParameters: - node (
Node) – TheNodeto run. - catalog (
DataCatalog) – ADataCatalogcontaining the node’s inputs and outputs. - inputs (
Dict[str,Any]) – The dictionary of inputs dataset. The keys are dataset names and the values are the actual loaded input data, not the dataset instance. - is_async (
bool) – Whether the node was run inasyncmode. - run_id (
str) – The id of the run.
Return type: None- node (
-
on_node_error(error, node, catalog, inputs, is_async, run_id)[source]¶ Hook to be invoked if a node run throws an uncaught error. The signature of this error hook should match the signature of
before_node_runalong with the error that was raised.Parameters: - error (
Exception) – The uncaught exception thrown during the node run. - node (
Node) – TheNodeto run. - catalog (
DataCatalog) – ADataCatalogcontaining the node’s inputs and outputs. - inputs (
Dict[str,Any]) – The dictionary of inputs dataset. The keys are dataset names and the values are the actual loaded input data, not the dataset instance. - is_async (
bool) – Whether the node was run inasyncmode. - run_id (
str) – The id of the run.
- error (
-