abhijeets25012-tech opened a new pull request, #72563:
URL: https://github.com/apache/airflow/pull/72563
### Description
Fixes #72544
`_get_parent_defaults` previously used `copy.copy` (shallow copy) when
merging `dag.default_args`. This caused nested mutable structures, specifically
`executor_config`, to be shared by object reference across all tasks and DAGs
inheriting from those shared defaults. Consequently, runtime mutations to
`task.executor_config` (such as setting Kubernetes pod overrides) silently
modified sibling tasks and unrelated DAGs.
This PR updates `_get_parent_defaults` to use `copy.deepcopy` and explicitly
deep-copies `executor_config` during `BaseOperator` initialization, ensuring
strict reference isolation across task definitions.
### Changes Made
- **`task-sdk/src/airflow/sdk/bases/operator.py`**:
- Replaced `copy.copy(dag.default_args)` with
`copy.deepcopy(dag.default_args)` in `_get_parent_defaults`.
- Updated `self.executor_config` assignment in `BaseOperator.__init__` to
use `copy.deepcopy(executor_config)` to isolate both explicit and inherited
configurations.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]