nvflare.fuel.utils.dict_utils module¶
- augment(to_dict: dict, from_dict: dict, from_override_to=False, append_list='components') str [source]¶
Augments the to_dict with the content from the from_dict.
Items in from_dict but not in to_dict are added to the to_dict
Items in both from_dict and to_dict must be ether dicts or list of dicts, and augment will be done on these items recursively
Non-dict/list items in both from_dict and to_dict are considered conflicts.
- Parameters:
to_dict – the dict to be augmented
from_dict – content to augment the to_dict
from_override_to – content in from_dict overrides content in to_dict when conflict happens
append_list – str or list of str: item keys for list to be appended
- Returns:
An error message if any; empty str if success.
Note
The content of the to_dict is updated