MCPcopy Index your code
hub / github.com/treeverse/dvc / _diff_dicts

Function _diff_dicts

dvc/utils/diff.py:42–56  ·  view source on GitHub ↗
(old_dict, new_dict, with_unchanged)

Source from the content-addressed store, hash-verified

40
41
42def _diff_dicts(old_dict, new_dict, with_unchanged):
43 new = _flatten(new_dict)
44 old = _flatten(old_dict)
45
46 res: dict[str, dict] = defaultdict(dict)
47
48 xpaths = set(old.keys())
49 xpaths.update(set(new.keys()))
50 for xpath in xpaths:
51 old_val = old[xpath]
52 new_val = new[xpath]
53 val_diff = _diff_vals(old_val, new_val, with_unchanged)
54 if val_diff:
55 res[xpath] = val_diff
56 return dict(res)
57
58
59def _diff(old_raw, new_raw, with_unchanged):

Callers 1

_diffFunction · 0.85

Calls 5

_flattenFunction · 0.85
_diff_valsFunction · 0.85
dictClass · 0.85
keysMethod · 0.80
updateMethod · 0.45

Tested by

no test coverage detected