server.web.repositories.task_repository

Repository for Task operations.

Attributes

logger

Classes

TaskRepository

Initialize the TaskRepository with a database session.

Module Contents

server.web.repositories.task_repository.logger
class server.web.repositories.task_repository.TaskRepository(session: sqlalchemy.orm.Session)

Initialize the TaskRepository with a database session.

session
update_task_statuses(workflow_id: str, recursive: bool, workflow_status: str | None, task_ids: List[int] | str, new_status: str) None

Update the status of tasks with business logic.

Description:

  • When task_ids='all', it updates all tasks in the workflow with recursive=False. This improves performance.

  • When recursive=True, it updates the tasks and its dependencies all the way up or down the DAG.

  • When recursive=False, it updates only the tasks in the task_ids list.

  • When workflow_status is None, it gets the workflow status from the db.

  • After updating the tasks, it checks the workflow status and updates it.

get_task_status(task_ids: int | List[int] | None, status: str | List[str] | None) jobmon.server.web.schemas.task.TaskStatusResponse

Get the status of tasks with filtering.

get_task_subdag(task_ids: List[int], task_status: List[str]) jobmon.server.web.schemas.task.TaskSubdagResponse

Get the sub DAG of given tasks.

get_task_dependencies(task_id: int) jobmon.server.web.schemas.task.TaskDependenciesResponse

Get task’s downstream and upstream tasks and their status.

get_task_resource_usage(task_id: int) jobmon.server.web.schemas.task.TaskResourceUsageResponse

Return the resource usage for a given Task ID.

get_downstream_tasks(task_ids: List[int], dag_id: int, client_version: str | None = None) jobmon.server.web.schemas.task.DownstreamTasksResponse

Get only the direct downstreams of a task.

get_task_instance_details(task_id: int) jobmon.server.web.schemas.task.TaskInstanceDetailsResponse

Get information about TaskInstances associated with specific Task ID.

get_task_details_viz(task_id: int) jobmon.server.web.schemas.task.TaskDetailsResponse

Get status of Task from Task ID.