client.dag ========== .. py:module:: client.dag .. autoapi-nested-parse:: The DAG captures the interconnected graph of tasks and their dependencies. Attributes ---------- .. autoapisummary:: client.dag.logger Classes ------- .. autoapisummary:: client.dag.Dag Module Contents --------------- .. py:data:: logger .. py:class:: Dag(requester: Optional[jobmon.core.requester.Requester] = None) Bases: :py:obj:`object` The DAG captures the interconnected graph of tasks and their dependencies. .. py:attribute:: nodes :type: Set[jobmon.client.node.Node] .. py:attribute:: requester :value: None .. py:property:: dag_id :type: int Database unique ID of this DAG. .. py:method:: add_node(node: jobmon.client.node.Node) -> None Add a node to this dag. :param node: Node to add to the dag :type node: jobmon.client.node.Node .. py:method:: bind(chunk_size: int = 500) -> int Retrieve an id for a matching dag from the server. If it doesn't exist, first create one, including its edges. .. py:method:: validate() -> None Validate the nodes and their dependencies. .. py:method:: _is_cyclic(dag_map: Dict[jobmon.client.node.Node, Set[jobmon.client.node.Node]]) -> bool Return true if the nodes are cyclic. This method is effectively a depth-first search looking for already-seen nodes, implemented using the "stack of iterators" pattern to get around Python's recursion limit of 1000. .. py:method:: _bulk_bind_nodes(chunk_size: int) -> None .. py:method:: _get_dag_id() -> Optional[int] .. py:method:: _bulk_insert_edges(dag_id: int, chunk_size: int = 500) -> None .. py:method:: __hash__() -> int Determined by hashing all sorted node hashes and their downstream. .. py:method:: __repr__() -> str A representation string for a Dag instance.