lifecycle.api.TaskSubmissionHookΒΆ
- class hamilton.lifecycle.api.TaskSubmissionHook[source]ΒΆ
Implement this to hook into the task submission process. Tasks are submitted to an executor, which then controls how and where the nodes associated with the task are run.
- pre_task_submission(*, run_id: str, task_id: str, nodes: list[Node], inputs: dict[str, Any], overrides: dict[str, Any], spawning_task_id: str | None, purpose: None)[source]ΒΆ
Hook that is called immediately prior to task submission to an executor as a task future. Note that this is only useful in dynamic execution, although we reserve the right to add this back into the standard hamilton execution pattern.
- Parameters:
run_id β ID of the run, unique in scope of the driver.
task_id β ID of the task.
nodes β Nodes that are being executed.
inputs β Inputs to the task.
overrides β Overrides to task execution.
spawning_task_id β ID of the task that spawned this task.
purpose β Purpose of the current task group.
- abstractmethod run_before_task_submission(*, run_id: str, task_id: str, nodes: list[Node], inputs: dict[str, Any], overrides: dict[str, Any], spawning_task_id: str | None, purpose: None, **future_kwargs)[source]ΒΆ
Runs prior to a task being submitted to an executor. By definition this is run outside of the task executor, on the process that executed the driver.
- Parameters:
run_id β ID of the run this is under.
task_id β ID of the task weβre launching.
nodes β Nodes that are part of this task
inputs β Inputs to the task
overrides β Overrides passed to the task
spawning_task_id β ID of the task that spawned this task
purpose β Purpose of the current task group
future_kwargs β Reserved for backwards compatibility.