diff --git a/dbt_common/contracts/config/base.py b/dbt_common/contracts/config/base.py index 65020a7..74e80dc 100644 --- a/dbt_common/contracts/config/base.py +++ b/dbt_common/contracts/config/base.py @@ -117,25 +117,27 @@ def same_contents(cls, unrendered: Dict[str, Any], other: Dict[str, Any]) -> boo @classmethod def update_from( - cls, dct: Dict[str, Any], data: Dict[str, Any], adapter_config_cls: Type[BaseConfig] + cls, + orig_dict: Dict[str, Any], + new_dict: Dict[str, Any], + adapter_config_cls: Type[BaseConfig], ) -> Dict[str, Any]: """Update and validate config given a dict. Given a dict of keys, update the current config from them, validate it, and return a new config with the updated values """ - # dct = self.to_dict(omit_none=False) - self_merged = cls._merge_dicts(dct, data) - dct.update(self_merged) + self_merged = cls._merge_dicts(orig_dict, new_dict) + new_dict.update(self_merged) - adapter_merged = adapter_config_cls._merge_dicts(dct, data) - dct.update(adapter_merged) + adapter_merged = adapter_config_cls._merge_dicts(orig_dict, new_dict) + new_dict.update(adapter_merged) # any remaining fields must be "clobber" - dct.update(data) + orig_dict.update(new_dict) - return dct + return orig_dict @classmethod def _merge_dicts(cls, src: Dict[str, Any], data: Dict[str, Any]) -> Dict[str, Any]: