Fix merge_nested_dicts_with_renaming function
This commit is contained in:
parent
9b41432c96
commit
b5c27724a6
1 changed files with 5 additions and 8 deletions
|
|
@ -488,11 +488,11 @@ def merge_nested_dicts_with_renaming(dict1, dict2):
|
|||
for key, value in dict2.items():
|
||||
if key in dict1 and isinstance(value, dict) and isinstance(dict1.get(key), dict):
|
||||
for sub_key, sub_value in value.items():
|
||||
if sub_key in dict1[key]:
|
||||
new_key = get_new_key(dict1[key], sub_key)
|
||||
dict1[key][new_key] = sub_value
|
||||
else:
|
||||
dict1[key][sub_key] = sub_value
|
||||
# if sub_key in dict1[key]:
|
||||
# new_key = get_new_key(dict1[key], sub_key)
|
||||
# dict1[key][new_key] = sub_value
|
||||
# else:
|
||||
dict1[key][sub_key] = sub_value
|
||||
else:
|
||||
dict1[key] = value
|
||||
return dict1
|
||||
|
|
@ -555,6 +555,3 @@ def create_and_validate_component(code: str) -> CustomComponent:
|
|||
component = CustomComponent(code=code)
|
||||
component.validate()
|
||||
return component
|
||||
return component
|
||||
return component
|
||||
return component
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue