(app_name, job_id, include_dependency_group=False,
                filter_deps=())
Return an iterator over all parent (app_name, job_id) pairs
    Given a child app_name and job_id

    `include_dependency_group` - (bool) If True,
        yield (app_name, job_id, dependency_group_name) tuples instead
    `filter_deps` - (list|tuple) only yield parents from a particular
        dependency group
Return an iterator over all parent (app_name, job_id) pairs
    Given a child app_name and job_id
Return an iterator over all parent ( app_name job_id ) pairs Given a child app_name and job_id
def get_parents(app_name, job_id, include_dependency_group=False,
                filter_deps=()):
    """Return an iterator over all parent (app_name, job_id) pairs
    Given a child app_name and job_id

    `include_dependency_group` - (bool) If True,
        yield (app_name, job_id, dependency_group_name) tuples instead
    `filter_deps` - (list|tuple) only yield parents from a particular
        dependency group

    """
    ld = dict(app_name=app_name, job_id=job_id)  # log details

    if job_id:
        parsed_job_id = parse_job_id(app_name, job_id)
        filter_deps = set(filter_deps)
        if 'dependency_group_name' in parsed_job_id:
            filter_deps.add(parsed_job_id['dependency_group_name'], )
    else:
        parsed_job_id = None

    for group_name, dep_group in _get_grps(app_name, filter_deps, ld):
        # dep_group is either a dict or list if dicts, where dicts contain
        # depends_on metadata.
        # ie.  group_name, dep_group = ("default", {"app_name": ["a", "b"]})

        dep_group = convert_dep_grp_to_parsed_list(app_name, dep_group)

        compatible = all(dep_group_and_job_id_compatible(
            grp, parsed_job_id, child_app_name=app_name)
            for grp in dep_group)
        if not compatible:
            log.debug(
                "ignore possible parents whose job_id can't match given child",
                extra=dict(dependency_group_name=group_name, **ld))
            continue

        for subgrp in dep_group:

            for rv in _get_parent_job_ids(
                    group_name, subgrp,
                    child_app_name=app_name, child_job_id=job_id, ld=ld):
                if include_dependency_group:
                    yield rv + (group_name, )
                else:
                    yield rv
def get_parents ( app_name , job_id , include_dependency_group = False , filter_deps = ( ) ) : ld = dict ( app_name = app_name , job_id = job_id ) # log details if job_id : parsed_job_id = parse_job_id ( app_name , job_id ) filter_deps = set ( filter_deps ) if 'dependency_group_name' in parsed_job_id : filter_deps . add ( parsed_job_id [ 'dependency_group_name' ] , ) else : parsed_job_id = None for group_name , dep_group in _get_grps ( app_name , filter_deps , ld ) : # dep_group is either a dict or list if dicts, where dicts contain # depends_on metadata. # ie.  group_name, dep_group = ("default", {"app_name": ["a", "b"]}) dep_group = convert_dep_grp_to_parsed_list ( app_name , dep_group ) compatible = all ( dep_group_and_job_id_compatible ( grp , parsed_job_id , child_app_name = app_name ) for grp in dep_group ) if not compatible : log . debug ( "ignore possible parents whose job_id can't match given child" , extra = dict ( dependency_group_name = group_name , * * ld ) ) continue for subgrp in dep_group : for rv in _get_parent_job_ids ( group_name , subgrp , child_app_name = app_name , child_job_id = job_id , ld = ld ) : if include_dependency_group : yield rv + ( group_name , ) else : yield rv