Skip to content

tasks

etl_craft.engine.repository.tasks

Tasks: resolving a code, what running one needs, and its parameters.

TaskExecutionDetail dataclass

What running a task needs beyond its parameters.

TargetTask dataclass

Another active SQL task in the same pipeline with the same TARGET_OBJECT.

FailureWatchMessage dataclass

A task watched through a FAILURE dependency, with its latest error message.

resolve_task_id

resolve_task_id(conn: Connection, pipeline_id: int, task_code: str) -> int

Return the id of active task task_code in pipeline_id; MetadataError if none.

fetch_task_codes

fetch_task_codes(conn: Connection, pipeline_id: int) -> dict[int, str]

Map the id of every active task in pipeline_id to its code.

fetch_task_execution_detail

fetch_task_execution_detail(conn: Connection, task_id: int) -> TaskExecutionDetail

Return what running task_id needs; the task must exist.

fetch_task_parameters

fetch_task_parameters(conn: Connection, task_id: int) -> dict[str, str]

Map each active parameter name of task_id to its value.

fetch_target_tasks

fetch_target_tasks(conn: Connection, pipeline_id: int, task_id: int, target_object: str) -> list[TargetTask]

Return the other active SQL tasks in pipeline_id writing target_object.

fetch_failure_watch_messages

fetch_failure_watch_messages(conn: Connection, task_id: int) -> list[FailureWatchMessage]

Return each task task_id watches through an active FAILURE dependency.

The message is from the watched task's latest run under any pipeline run, since it may be in another pipeline with no run in common.