(dep_grp, ld, tasks_conf)
Do the user defined job_id validations, if they exist,
    apply to each individual value of the relevant key in the dep group?
Do the user defined job_id validations, if they exist,
    apply to each individual value of the relevant key in the dep group?
Do the user defined job_id validations if they exist apply to each individual value of the relevant key in the dep group?
def _validate_dep_grp_with_job_id_validations(dep_grp, ld, tasks_conf):
    """Do the user defined job_id validations, if they exist,
    apply to each individual value of the relevant key in the dep group?"""
    for k, v in dep_grp.items():

        # don't do validation on depends_on."app_name" field here,
        # and not for the depends_on."job_id" either
        # These fields are the only two fields in depends_on that are
        # not job_id components
        if k in ["app_name", "job_id"]:
            continue

        func = get_NS().job_id_validations.get(k)

        # ensure that job_id validations are fully specified for keys in
        # depends_on sections
        _log_raise_if(
            not func,
            "You introduced a new job_id component in a"
            " <app_name>.depends_on.<key> subsection, and you must inform"
            " Stolos how to parse the component", extra=dict(
                key=k, value=v, **ld), exception_kls=DAGMisconfigured)

        # skip rest of validations if "all" is used
        if v == "all":
            # assert that autofill_values exists on all parents

            msg = (
                " You requested that child depends on \"all\" values for some"
                " part of its parent job_id_template.  If you do this,"
                " the parent must define"
                " <parent_app_name>.autofill_values.<key>")
            for parent in dep_grp['app_name']:
                _log_raise_if(
                    k not in tasks_conf[parent].get('autofill_values', {}),
                    msg, extra=dict(parent_app_name=parent, key=k, **ld),
                    exception_kls=DAGMisconfigured)
            continue

        for vv in v:
            try:
                res = func(vv)
            except Exception as err:
                _log_raise((
                    "Invalid data at <app_name>.depends_on.<key>.[nth_value]."
                    " The job_id_validation function complained that the"
                    " value was invalid. Error details: %s"
                ) % err.message,
                    extra=dict(key='%s.%s' % (k, v), value=vv, **ld),
                    exception_kls=DAGMisconfigured)

            _log_raise_if(
                vv != res,
                ("A job_id_validation func just returned a modified"
                 " value.  It should return input unmodified or fail."),
                extra=dict(
                    key='%s.%s' % (k, v), value=vv, job_id_validation=func,
                    **ld),
                exception_kls=DAGMisconfigured)
def _validate_dep_grp_with_job_id_validations ( dep_grp , ld , tasks_conf ) : for k , v in dep_grp . items ( ) : # don't do validation on depends_on."app_name" field here, # and not for the depends_on."job_id" either # These fields are the only two fields in depends_on that are # not job_id components if k in [ "app_name" , "job_id" ] : continue func = get_NS ( ) . job_id_validations . get ( k ) # ensure that job_id validations are fully specified for keys in # depends_on sections _log_raise_if ( not func , "You introduced a new job_id component in a" " <app_name>.depends_on.<key> subsection, and you must inform" " Stolos how to parse the component" , extra = dict ( key = k , value = v , * * ld ) , exception_kls = DAGMisconfigured ) # skip rest of validations if "all" is used if v == "all" : # assert that autofill_values exists on all parents msg = ( " You requested that child depends on \"all\" values for some" " part of its parent job_id_template.  If you do this," " the parent must define" " <parent_app_name>.autofill_values.<key>" ) for parent in dep_grp [ 'app_name' ] : _log_raise_if ( k not in tasks_conf [ parent ] . get ( 'autofill_values' , { } ) , msg , extra = dict ( parent_app_name = parent , key = k , * * ld ) , exception_kls = DAGMisconfigured ) continue for vv in v : try : res = func ( vv ) except Exception as err : _log_raise ( ( "Invalid data at <app_name>.depends_on.<key>.[nth_value]." " The job_id_validation function complained that the" " value was invalid. Error details: %s" ) % err . message , extra = dict ( key = '%s.%s' % ( k , v ) , value = vv , * * ld ) , exception_kls = DAGMisconfigured ) _log_raise_if ( vv != res , ( "A job_id_validation func just returned a modified" " value.  It should return input unmodified or fail." ) , extra = dict ( key = '%s.%s' % ( k , v ) , value = vv , job_id_validation = func , * * ld ) , exception_kls = DAGMisconfigured )