msumit commented on a change in pull request #17100:
URL: https://github.com/apache/airflow/pull/17100#discussion_r680464184
##########
File path: airflow/models/dag.py
##########
@@ -1976,7 +1981,7 @@ def create_dagrun(
run_id: Optional[str] = None,
start_date: Optional[datetime] = None,
external_trigger: Optional[bool] = False,
- conf: Optional[dict] = None,
+ conf: Optional[dict] = {},
Review comment:
@kaxil I think the way we are using the `conf` variable, it would be
safe from this gotcha, for example see this
```
def safe_func(args={}):
print(args)
def prob_func(arg1={}, arg2={}):
arg2.update(arg1)
print(arg2)
if __name__ == '__main__':
safe_func(args={'a': 1})
safe_func()
safe_func(args={'a': 2})
prob_func(arg1={'a': 1})
prob_func()
prob_func(arg1={'a': 2})
```
generate outputs:
```
{'a': 1}
{}
{'a': 2}
{'a': 1}
{'a': 1}
{'a': 2}
```
--
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]