kedro/config/config.py
def _load_config(config_files: List[Path]) -> Dict[str, Any]:
    """Recursively load all configuration files, which satisfy
    a given list of glob patterns from a specific path.

    Args:
        config_files: Configuration files sorted in the order of precedence.

    Raises:
        ValueError: If 2 or more configuration files contain the same key(s).

    Returns:
        Resulting configuration dictionary.

    """
    # for performance reasons
    import anyconfig  # pylint: disable=import-outside-toplevel

    config = {}
    keys_by_filepath = {}  # type: Dict[Path, AbstractSet[str]]

    def _check_dups(file1: Path, conf: Dict[str, Any]) -> None:
        dups = set()
        for file2, keys in keys_by_filepath.items():
            common = ", ".join(sorted(conf.keys() & keys))
            if common:
                if len(common) > 100:
                    common = common[:100] + "..."
                dups.add("{}: {}".format(str(file2), common))

        if dups:
            msg = "Duplicate keys found in {0} and:\n- {1}".format(
                file1, "\n- ".join(dups)
            )
            raise ValueError(msg)

    for config_file in config_files:
        cfg = {
            k: v
            for k, v in anyconfig.load(config_file).items()
            if not k.startswith("_")
        }
        _check_dups(config_file, cfg)
        keys_by_filepath[config_file] = cfg.keys()
        config.update(cfg)
    return config
Recursively load all configuration files, which satisfy
    a given list of glob patterns from a specific path.

    Args:
        config_files: Configuration files sorted in the order of precedence.

    Raises:
        ValueError: If 2 or more configuration files contain the same key(s).

    Returns:
        Resulting configuration dictionary.

    
Recursively load all configuration files, which satisfy
a given list of glob patterns from a specific path.
Recursively load all configuration files which satisfy a given list of glob patterns from a specific path .
def _load_config(config_files: List[Path]) -> Dict[str, Any]:
    import anyconfig  
    config = {}
    keys_by_filepath = {}  
    def _check_dups(file1: Path, conf: Dict[str, Any]) -> None:
        dups = set()
        for file2, keys in keys_by_filepath.items():
            common = ", ".join(sorted(conf.keys() & keys))
            if common:
                if len(common) > 100:
                    common = common[:100] + "..."
                dups.add("{}: {}".format(str(file2), common))
        if dups:
            msg = "Duplicate keys found in {0} and:\n- {1}".format(
                file1, "\n- ".join(dups)
            )
            raise ValueError(msg)
    for config_file in config_files:
        cfg = {
            k: v
            for k, v in anyconfig.load(config_file).items()
            if not k.startswith("_")
        }
        _check_dups(config_file, cfg)
        keys_by_filepath[config_file] = cfg.keys()
        config.update(cfg)
    return config
def _load_config ( config_files : List [ Path ] ) -> Dict [ str , Any ] : import anyconfig config = { } keys_by_filepath = { } def _check_dups ( file1 : Path , conf : Dict [ str , Any ] ) -> None : dups = set ( ) for file2 , keys in keys_by_filepath . items ( ) : common = ", " . join ( sorted ( conf . keys ( ) & keys ) ) if common : if len ( common ) > 100 : common = common [ : 100 ] + "..." dups . add ( "{}: {}" . format ( str ( file2 ) , common ) ) if dups : msg = "Duplicate keys found in {0} and:\n- {1}" . format ( file1 , "\n- " . join ( dups ) ) raise ValueError ( msg ) for config_file in config_files : cfg = { k : v for k , v in anyconfig . load ( config_file ) . items ( ) if not k . startswith ( "_" ) } _check_dups ( config_file , cfg ) keys_by_filepath [ config_file ] = cfg . keys ( ) config . update ( cfg ) return config
Recursively load all configuration files, which satisfy
a given list of glob patterns from a specific path.
Recursively load all configuration files which satisfy a given list of glob patterns from a specific path .
"""Recursively load all configuration files, which satisfy
    a given list of glob patterns from a specific path.

    Args:
        config_files: Configuration files sorted in the order of precedence.

    Raises:
        ValueError: If 2 or more configuration files contain the same key(s).

    Returns:
        Resulting configuration dictionary.

    """ # for performance reasons # pylint: disable=import-outside-toplevel # type: Dict[Path, AbstractSet[str]]
Resulting configuration dictionary.
Resulting configuration dictionary .
If 2 or more configuration files contain the same key(s).
If 2 or more configuration files contain the same key ( s ) .
ValueError
config_files
List[Path]
Configuration files sorted in the order of precedence.
Configuration files sorted in the order of precedence .