We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5c3aaf5 commit 748f74dCopy full SHA for 748f74d
ecs_logging/_utils.py
@@ -64,6 +64,8 @@ def flatten_dict(value):
64
def normalize_dict(value):
65
# type: (Dict[str, Any]) -> Dict[str, Any]
66
"""Expands all dotted names to nested dictionaries"""
67
+ if not isinstance(value, dict):
68
+ return value
69
keys = list(value.keys())
70
for key in keys:
71
if "." in key:
tests/test_utils.py
@@ -26,3 +26,7 @@ def test_normalize_dict():
26
assert normalize_dict(
27
{"a": {"b": 1}, "a.c": {"d.e": {"f": 1}, "d.e.g": [{"f.c": 2}]}}
28
) == {"a": {"b": 1, "c": {"d": {"e": {"f": 1, "g": [{"f": {"c": 2}}]}}}}}
29
+
30
31
+def test_normalize_dict_with_array():
32
+ assert normalize_dict({"a": ["1", "2"]}) == {"a": ["1", "2"]}
0 commit comments