diff --git a/kedro/config/omegaconf_config.py b/kedro/config/omegaconf_config.py index 4d2ace59d4..37e92f211c 100644 --- a/kedro/config/omegaconf_config.py +++ b/kedro/config/omegaconf_config.py @@ -287,17 +287,20 @@ def load_and_merge_dir_config( # noqa: too-many-arguments return {} if key == "parameters": - # Merge with runtime parameters only for "parameters" - return OmegaConf.to_container( + merged_conf = OmegaConf.to_container( OmegaConf.merge(*aggregate_config, self.runtime_params), resolve=True ) - return { - k: v - for k, v in OmegaConf.to_container( - OmegaConf.merge(*aggregate_config), resolve=True - ).items() - if not k.startswith("_") - } + else: + original_keys = OmegaConf.merge(*aggregate_config).keys() + merged_conf = { + k: v + for k, v in OmegaConf.to_container( + OmegaConf.merge(*aggregate_config, self.runtime_params), + resolve=True, + ).items() + if not k.startswith("_") and k in original_keys + } + return merged_conf def _is_valid_config_path(self, path): """Check if given path is a file path and file type is yaml or json."""