server.web.repositories.task_repository ======================================= .. py:module:: server.web.repositories.task_repository .. autoapi-nested-parse:: Repository for Task operations. Attributes ---------- .. autoapisummary:: server.web.repositories.task_repository.logger Classes ------- .. autoapisummary:: server.web.repositories.task_repository.TaskRepository Module Contents --------------- .. py:data:: logger .. py:class:: TaskRepository(session: sqlalchemy.orm.Session) Initialize the TaskRepository with a database session. .. py:attribute:: session .. py:method:: update_task_statuses(workflow_id: str, recursive: bool, workflow_status: Optional[str], task_ids: Union[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. .. py:method:: get_task_status(task_ids: Optional[Union[int, List[int]]], status: Optional[Union[str, List[str]]]) -> jobmon.server.web.schemas.task.TaskStatusResponse Get the status of tasks with filtering. .. py:method:: get_task_subdag(task_ids: List[int], task_status: List[str]) -> jobmon.server.web.schemas.task.TaskSubdagResponse Get the sub DAG of given tasks. .. py:method:: get_task_dependencies(task_id: int) -> jobmon.server.web.schemas.task.TaskDependenciesResponse Get task's downstream and upstream tasks and their status. .. py:method:: get_task_resource_usage(task_id: int) -> jobmon.server.web.schemas.task.TaskResourceUsageResponse Return the resource usage for a given Task ID. .. py:method:: get_downstream_tasks(task_ids: List[int], dag_id: int, client_version: Optional[str] = None) -> jobmon.server.web.schemas.task.DownstreamTasksResponse Get only the direct downstreams of a task. .. py:method:: get_task_instance_details(task_id: int) -> jobmon.server.web.schemas.task.TaskInstanceDetailsResponse Get information about TaskInstances associated with specific Task ID. .. py:method:: get_task_details_viz(task_id: int) -> jobmon.server.web.schemas.task.TaskDetailsResponse Get status of Task from Task ID.