From 4b171ac45d68cebd7a2b4755f758f897f62e07e6 Mon Sep 17 00:00:00 2001 From: pankajastro Date: Fri, 3 Jan 2025 13:03:52 +0530 Subject: [PATCH] cleanup --- dagfactory/dagfactory.py | 13 ++++--------- dev/dags/defaults.yml | 2 +- 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/dagfactory/dagfactory.py b/dagfactory/dagfactory.py index bfc2227e..30a5e077 100644 --- a/dagfactory/dagfactory.py +++ b/dagfactory/dagfactory.py @@ -45,19 +45,14 @@ def _global_default_args(): with open(default_args_yml, "r") as file: return yaml.safe_load(file) - def deep_merge(self, dict1, dict2): - for key, value in dict2.items(): - if isinstance(value, dict) and key in dict1 and isinstance(dict1[key], dict): - dict1[key] = self.deep_merge(dict1[key], value) - else: - dict1[key] = value - return dict1 - def _merge_default_args(self): global_default_args = self._global_default_args() default_config: Dict[str, Any] = self.get_default_config() - return self.deep_merge(global_default_args, default_config) + merged_config = global_default_args.copy() + merged_config.update(default_config) + + return merged_config @staticmethod def _serialise_config_md(dag_name, dag_config, default_config): diff --git a/dev/dags/defaults.yml b/dev/dags/defaults.yml index 1712ff63..8883fed3 100644 --- a/dev/dags/defaults.yml +++ b/dev/dags/defaults.yml @@ -1,3 +1,3 @@ default_args: start_date: "2024-01-01" - owner: "default_owner1" + owner: "global_owner"