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:
[email protected]


With regards,
Apache Git Services

Reply via email to