(extractors: Union[List, Dict])
return v3_extractors
convert extract list(v2) to dict(v3)

    Args:
        extractors: [{"varA": "content.varA"}, {"varB": "json.varB"}]

    Returns:
        {"varA": "body.varA", "varB": "body.varB"}
convert extract list(v2) to dict(v3)
convert extract list ( v2 ) to dict ( v3 )
def _convert_extractors(extractors: Union[List, Dict]) -> Dict:
    """ convert extract list(v2) to dict(v3)

    Args:
        extractors: [{"varA": "content.varA"}, {"varB": "json.varB"}]

    Returns:
        {"varA": "body.varA", "varB": "body.varB"}

    """
    v3_extractors: Dict = {}

    if isinstance(extractors, List):
        # [{"varA": "content.varA"}, {"varB": "json.varB"}]
        for extractor in extractors:
            if not isinstance(extractor, Dict):
                logger.error(f"Invalid extractor: {extractors}")
                sys.exit(1)
            for k, v in extractor.items():
                v3_extractors[k] = v
    elif isinstance(extractors, Dict):
        # {"varA": "body.varA", "varB": "body.varB"}
        v3_extractors = extractors
    else:
        logger.error(f"Invalid extractor: {extractors}")
        sys.exit(1)

    for k, v in v3_extractors.items():
        v3_extractors[k] = _convert_jmespath(v)

    return v3_extractors
def _convert_extractors ( extractors : Union [ List , Dict ] ) -> Dict : v3_extractors : Dict = { } if isinstance ( extractors , List ) : # [{"varA": "content.varA"}, {"varB": "json.varB"}] for extractor in extractors : if not isinstance ( extractor , Dict ) : logger . error ( f"Invalid extractor: {extractors}" ) sys . exit ( 1 ) for k , v in extractor . items ( ) : v3_extractors [ k ] = v elif isinstance ( extractors , Dict ) : # {"varA": "body.varA", "varB": "body.varB"} v3_extractors = extractors else : logger . error ( f"Invalid extractor: {extractors}" ) sys . exit ( 1 ) for k , v in v3_extractors . items ( ) : v3_extractors [ k ] = _convert_jmespath ( v ) return v3_extractors