From 819a224e4476d97b1c538ba980a408eacde136be Mon Sep 17 00:00:00 2001 From: Nok Chan Date: Thu, 18 May 2023 17:02:23 +0100 Subject: [PATCH] Refactor the merge&resolve method Signed-off-by: Nok Chan --- kedro/config/omegaconf_config.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/kedro/config/omegaconf_config.py b/kedro/config/omegaconf_config.py index e41f2ace41..daa2998a60 100644 --- a/kedro/config/omegaconf_config.py +++ b/kedro/config/omegaconf_config.py @@ -248,12 +248,15 @@ def load_and_merge_dir_config( # pylint: disable=too-many-arguments self._check_duplicates(seen_file_to_keys) aggregate_config = config_per_file.values() + return self._merge_and_resolve_config(key, aggregate_config) + + def _merge_and_resolve_config(self, key, aggregate_config): if not aggregate_config: return {} if key == "parameters": # Merge with runtime parameters only for "parameters" - return OmegaConf.to_container( + return OmegaConf.to_container( OmegaConf.merge(*aggregate_config, self.runtime_params), resolve=True ) return OmegaConf.to_container(OmegaConf.merge(*aggregate_config), resolve=True)