Skip to content

Commit

Permalink
Use exiting recursive dict merge helper
Browse files Browse the repository at this point in the history
  • Loading branch information
o-nikolas committed Feb 1, 2024
1 parent d97fb1e commit bf0014a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 15 deletions.
4 changes: 2 additions & 2 deletions airflow/providers/amazon/aws/executors/ecs/ecs_executor.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,11 @@
EcsExecutorException,
EcsQueuedTask,
EcsTaskCollection,
_deep_update,
)
from airflow.providers.amazon.aws.executors.utils.exponential_backoff_retry import exponential_backoff_retry
from airflow.providers.amazon.aws.hooks.ecs import EcsHook
from airflow.utils import timezone
from airflow.utils.helpers import merge_dicts
from airflow.utils.state import State

if TYPE_CHECKING:
Expand Down Expand Up @@ -408,7 +408,7 @@ def _run_task_kwargs(
One last chance to modify Boto3's "run_task" kwarg params before it gets passed into the Boto3 client.
"""
run_task_kwargs = deepcopy(self.run_task_kwargs)
run_task_kwargs = _deep_update(run_task_kwargs, exec_config)
run_task_kwargs = merge_dicts(run_task_kwargs, exec_config)
container_override = self.get_container(run_task_kwargs["overrides"]["containerOverrides"])
container_override["command"] = cmd

Expand Down
13 changes: 0 additions & 13 deletions airflow/providers/amazon/aws/executors/ecs/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -264,16 +264,3 @@ def camelize_dict_keys(nested_dict) -> dict:
else:
result[new_key] = nested_dict[key]
return result


def _deep_update(dest_dict: dict, source_dict: dict) -> dict:
"""Deep updates dest_dict with the values from source_dict."""
for key, value in source_dict.items():
if key in dest_dict and isinstance(dest_dict[key], dict) and isinstance(value, dict):
# Recursively update nested dictionaries
_deep_update(dest_dict[key], value)
else:
# Update or add key-value pairs
dest_dict[key] = value

return dest_dict

0 comments on commit bf0014a

Please sign in to comment.