Skip to content

Commit

Permalink
Refactor the merge&resolve method
Browse files Browse the repository at this point in the history
Signed-off-by: Nok Chan <[email protected]>
  • Loading branch information
noklam committed May 18, 2023
1 parent 8ea71bb commit 819a224
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion kedro/config/omegaconf_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 819a224

Please sign in to comment.