Skip to content

Commit

Permalink
feat: enable dictionary overriding
Browse files Browse the repository at this point in the history
  • Loading branch information
Adamantios committed Aug 9, 2024
1 parent 80b4321 commit 2edaf44
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion aea/helpers/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -711,10 +711,14 @@ def dict_to_path_value(
"""Convert dict to sequence of terminal path build of keys and value."""
path = path or []
for key, value in data.items():
# terminal value
if isinstance(value, Mapping) and value:
# terminal value
# yielding here allows for higher level dict overriding
yield path + [key], value
# recursing to the next level of the dict
for p, v in dict_to_path_value(value, path + [key]):
yield p, v
# non-terminal value
else:
yield path + [key], value

Expand Down

0 comments on commit 2edaf44

Please sign in to comment.