nikolauspschuetz opened a new pull request, #70349:
URL: https://github.com/apache/airflow/pull/70349
`merge_dicts` recurses whenever the value in `dict2` is a dict, without
checking that the existing value in `dict1` is also a dict. Merging a dict over
a scalar or list value therefore raised instead of overwriting it,
contradicting the documented contract ("Items in dict2 overwrite those also
found in dict1").
Reproduces on `main`:
```python
merge_dicts({"a": 1}, {"a": {"b": 2}}) # AttributeError: 'int' object
has no attribute 'copy'
merge_dicts({"a": [1, 2]}, {"a": {"b": 2}}) # TypeError: list indices must
be integers or slices, not str
```
Both now return `{"a": {"b": 2}}`. Adds a regression test; the existing
`merge_dicts` tests still pass.
---
##### Was generative AI tooling used to co-author this PR?
- [X] Yes — Claude Code (Opus 4.8)
Generated-by: Claude Code (Opus 4.8) following [the
guidelines](https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#gen-ai-assisted-contributions)
--
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]