client.commands.task ==================== .. py:module:: client.commands.task .. autoapi-nested-parse:: Task-related commands. Commands for querying and managing task state, including: - Task status queries - Task status updates - Task dependencies Attributes ---------- .. autoapisummary:: client.commands.task.logger Functions --------- .. autoapisummary:: client.commands.task.task_status client.commands.task.update_task_status client.commands.task.get_sub_task_tree client.commands.task.get_task_dependencies Module Contents --------------- .. py:data:: logger .. py:function:: task_status(task_ids: List[int], status: Optional[List[str]] = None, json: bool = False, requester: Optional[jobmon.core.requester.Requester] = None) -> Union[dict, pandas.DataFrame] Get metadata about a task and its task instances. :param task_ids: a list of task_ids to retrieve task_instance metadata for. :param status: a list of statuses to check for. :param json: Flag to return data as JSON. :param requester: object to communicate with the flask services :returns: Task status and task_instance metadata .. py:function:: update_task_status(task_ids: List[int], workflow_id: int, new_status: str, force: bool = False, recursive: bool = False, requester: Optional[jobmon.core.requester.Requester] = None) -> Any Set the specified task IDs to the new status, pending validation. :param task_ids: List of task IDs to reset in the database :param workflow_id: The workflow to which each task belongs. Users can only self-service 1 workflow at a time for the moment. :param new_status: the status to set tasks to :param force: if true, allow all source statuses and all workflow statuses. :param recursive: if true and force, apply recursive update_status downstream or upstream depending on new_status (upstream if new_status == 'D'; downstream if new_status == 'G'). :param requester: object to communicate with the flask services :returns: Server response with update results .. py:function:: get_sub_task_tree(task_ids: list, task_status: Optional[list] = None, requester: Optional[jobmon.core.requester.Requester] = None) -> dict Get the sub_tree from tasks to ensure that they end up in the right states. :param task_ids: List of task IDs to get the subtree for :param task_status: Optional filter by task status :param requester: object to communicate with the flask services :returns: Dictionary mapping task IDs to their subtree information .. py:function:: get_task_dependencies(task_id: int, requester: Optional[jobmon.core.requester.Requester] = None) -> dict Get the upstream and downstream dependencies of a task. :param task_id: The task ID to get dependencies for :param requester: object to communicate with the flask services :returns: Dictionary with 'up' and 'down' keys containing dependency information