lifecycle.api.NodeExecutionMethod#

class hamilton.lifecycle.api.NodeExecutionMethod#

API for executing a node. This takes in tags, callable, node name, and kwargs, and is responsible for executing the node and returning the result. Note this is not (currently) able to be layered together, although we may add that soon.

final do_node_execute(*, run_id: str, node_: Node, kwargs: Dict[str, Any], task_id: str | None = None) Any#

Method that is called to implement node execution. This can replace the execution of a node with something all together, augment it, or delegate it.

Parameters:
  • run_id – ID of the run, unique in scope of the driver.

  • node – Node that is being executed

  • kwargs – Keyword arguments that are being passed into the node

  • task_id – ID of the task, defaults to None if not in a task setting

abstract run_to_execute_node(*, node_name: str, node_tags: Dict[str, Any], node_callable: Any, node_kwargs: Dict[str, Any], task_id: str | None, **future_kwargs: Any) Any#

This method is responsible for executing the node and returning the result.

Parameters:
  • node_name – Name of the node.

  • node_tags – Tags of the node.

  • node_callable – Callable of the node.

  • node_kwargs – Keyword arguments to pass to the node.

  • task_id – The ID of the task, none if not in a task-based environment

  • future_kwargs – Additional keyword arguments – this is kept for backwards compatibility

Returns:

The result of the node execution – up to you to return this.