(dg, app_name, dep_name, dep_grp, log_details)
Add edge(s) to a networkx graph instance

    `dg` is an instance of a nx.MultiDiGraph, which means we can have
        multiple edges between two nodes
    `dep_name` (str) - the name of a dependency group
    `dep_grp` (obj) - dependency group data.  Subclass of
        cb.TasksConfigBaseMapping.  An example of what this may look like is:
            dep_grp = {
                "app_name": ["test_app"],
                "date": [20140601],
                "client_id": [123, 140, 150],
                ...
            }
Add edge(s) to a networkx graph instance
Add edge ( s ) to a networkx graph instance
def _add_edges(dg, app_name, dep_name, dep_grp, log_details):
    """Add edge(s) to a networkx graph instance

    `dg` is an instance of a nx.MultiDiGraph, which means we can have
        multiple edges between two nodes
    `dep_name` (str) - the name of a dependency group
    `dep_grp` (obj) - dependency group data.  Subclass of
        cb.TasksConfigBaseMapping.  An example of what this may look like is:
            dep_grp = {
                "app_name": ["test_app"],
                "date": [20140601],
                "client_id": [123, 140, 150],
                ...
            }
    """
    try:
        parent = dep_grp['app_name']
    except (KeyError, TypeError):
        raise DAGMisconfigured(
            "You defined a dependency but forgot to include the app_name")
    if isinstance(parent, six.string_types):
        dg.add_edge(parent, app_name, key=dep_name, label=dep_name)
    elif isinstance(parent, cb.TasksConfigBaseSequence):
        for _parent in parent:
            dg.add_edge(_parent, app_name, key=dep_name, label=dep_name)
    else:
        _log_raise((
            "Unrecognized type:"
            " I found a child that doesn't properly define parents."
            " Children should have the parent app_name"
            " define a string or sequence"
            " of strings that represent the child's parents."),
            dict(parent_app_name=parent, parent_app_name_type=type(parent),
                 **log_details),
            exception_kls=DAGMisconfigured)
def _add_edges ( dg , app_name , dep_name , dep_grp , log_details ) : try : parent = dep_grp [ 'app_name' ] except ( KeyError , TypeError ) : raise DAGMisconfigured ( "You defined a dependency but forgot to include the app_name" ) if isinstance ( parent , six . string_types ) : dg . add_edge ( parent , app_name , key = dep_name , label = dep_name ) elif isinstance ( parent , cb . TasksConfigBaseSequence ) : for _parent in parent : dg . add_edge ( _parent , app_name , key = dep_name , label = dep_name ) else : _log_raise ( ( "Unrecognized type:" " I found a child that doesn't properly define parents." " Children should have the parent app_name" " define a string or sequence" " of strings that represent the child's parents." ) , dict ( parent_app_name = parent , parent_app_name_type = type ( parent ) , * * log_details ) , exception_kls = DAGMisconfigured )