kaxil commented on code in PR #70349:
URL: https://github.com/apache/airflow/pull/70349#discussion_r4688943023
##########
airflow-core/tests/unit/utils/test_helpers.py:
##########
@@ -113,6 +113,14 @@ def test_merge_dicts_recursive_right_only(self):
merged = merge_dicts(dict1, dict2)
assert merged == {"a": 1, "r": {"b": 0, "c": 3}}
+ def test_merge_dicts_overwrites_non_dict_with_dict(self):
+ """
+ When dict1 holds a non-dict for a key and dict2 holds a dict, dict2
overwrites
+ (per the documented contract) instead of recursing into the non-dict
and raising.
+ """
+ assert merge_dicts({"a": 1}, {"a": {"b": 2}}) == {"a": {"b": 2}}
Review Comment:
+1 to parametrizing. Can you add a string case (`"x"`) too? That crashed the
old code as well.
--
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]