class documentation

class NodeSpecs: (source)

View In Hierarchy

Namespace that defines all specifications for a node's lifecycle hooks.

Method after_node_run Hook to be invoked after a node runs. The arguments received are the same as those used by kedro.runner.run_node as well as the outputs of the node run.
Method before_node_run Hook to be invoked before a node runs. The arguments received are the same as those used by kedro.runner.run_node
Method on_node_error 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_run along with the error that was raised.
@hook_spec
def after_node_run(self, node: Node, catalog: DataCatalog, inputs: Dict[str, Any], outputs: Dict[str, Any], is_async: bool, session_id: str): (source)

Hook to be invoked after a node runs. The arguments received are the same as those used by kedro.runner.run_node as well as the outputs of the node run.

Parameters
node:NodeThe Node that ran.
catalog:DataCatalogA DataCatalog containing 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:boolWhether the node was run in async mode.
session_id:strThe id of the session.
@hook_spec
def before_node_run(self, node: Node, catalog: DataCatalog, inputs: Dict[str, Any], is_async: bool, session_id: str) -> Optional[Dict[str, Any]]: (source)

Hook to be invoked before a node runs. The arguments received are the same as those used by kedro.runner.run_node

Parameters
node:NodeThe Node to run.
catalog:DataCatalogA DataCatalog containing 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:boolWhether the node was run in async mode.
session_id:strThe id of the session.
Returns
Optional[Dict[str, Any]]
Either None or a dictionary mapping dataset name(s) to new value(s).
If returned, this dictionary will be used to update the node inputs, which allows to overwrite the node inputs.
@hook_spec
def on_node_error(self, error: Exception, node: Node, catalog: DataCatalog, inputs: Dict[str, Any], is_async: bool, session_id: str): (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_run along with the error that was raised.

Parameters
error:ExceptionThe uncaught exception thrown during the node run.
node:NodeThe Node to run.
catalog:DataCatalogA DataCatalog containing 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:boolWhether the node was run in async mode.
session_id:strThe id of the session.