client.dag

The DAG captures the interconnected graph of tasks and their dependencies.

Attributes

logger

Classes

Dag

The DAG captures the interconnected graph of tasks and their dependencies.

Module Contents

client.dag.logger[source]
class client.dag.Dag(requester: jobmon.core.requester.Requester | None = None)[source]

Bases: object

The DAG captures the interconnected graph of tasks and their dependencies.

nodes: Set[jobmon.client.node.Node][source]
requester = None[source]
property dag_id: int[source]

Database unique ID of this DAG.

add_node(node: jobmon.client.node.Node) None[source]

Add a node to this dag.

Parameters:

node (jobmon.client.node.Node) – Node to add to the dag

bind(chunk_size: int = 500) int[source]

Retrieve an id for a matching dag from the server.

If it doesn’t exist, first create one, including its edges.

validate() None[source]

Validate the nodes and their dependencies.

_is_cyclic(dag_map: Dict[jobmon.client.node.Node, Set[jobmon.client.node.Node]]) bool[source]

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.

_bulk_bind_nodes(chunk_size: int) None[source]
_get_dag_id() int | None[source]
_bulk_insert_edges(dag_id: int, chunk_size: int = 500) None[source]
__hash__() int[source]

Determined by hashing all sorted node hashes and their downstream.

__repr__() str[source]

A representation string for a Dag instance.