You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2019/06/30 19:28:54 UTC
[GitHub] [airflow] Fokko commented on a change in pull request #5277:
[AIRFLOW-4510] Don't mutate default_args during DAG initialization
Fokko commented on a change in pull request #5277: [AIRFLOW-4510] Don't mutate default_args during DAG initialization
URL: https://github.com/apache/airflow/pull/5277#discussion_r298846327
##########
File path: airflow/models/dag.py
##########
@@ -195,7 +195,7 @@ def __init__(
):
self.user_defined_macros = user_defined_macros
self.user_defined_filters = user_defined_filters
- self.default_args = default_args or {}
+ self.default_args = dict(default_args or {})
Review comment:
Maybe do a deepcopy then, so we are sure that the references aren't mutated as well.
```suggestion
import copy
self.default_args = copy.deepcopy(default_args)
```
WDYT?
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services