DAG
set_logger
Sets a logger for this DAG. Throws error if not a valid logger.
is_node
The node to check.
Returns boolean indicating whether the node is a Node
.
add_node
The node to set as the root. Adds to nodes
if not added already. Throws error if not a valid node.
remove_node
The node to remove. Throws errors if not a valid node or if the node is not in the graph.
get_node
The node id to get. Throws error if not a valid id or if node not in graph.
add_edge
The node to add the edge from. Throws error if not a valid node or if node not in graph.
The node to add the edge to. Throws error if not a valid node, if node not in graph, or if there’s a cycle.
A function to transform the outputs of from_node
for to_node
. Defaults to lambda x: x
.
remove_edge
The node to add the edge from. Throws error if not a valid node or if node not in graph.
The node to add the edge to. Throws error if not a valid node, if node not in graph, or if there’s a cycle.
execute
Topologically sorts the graph and runs it.
A dictionary of node_id keys -> its initial args and kwargs, which will be set to execute_args
once the DAG runs.