MCPcopy Create free account
hub / github.com/treeverse/dvc / diff

Function diff

dvc/utils/diff.py:73–86  ·  view source on GitHub ↗
(old, new, with_unchanged=False)

Source from the content-addressed store, hash-verified

71
72
73def diff(old, new, with_unchanged=False):
74 paths = set(old.keys())
75 paths.update(set(new.keys()))
76
77 res: dict[str, dict] = defaultdict(dict)
78 for path in paths:
79 path_diff = _diff(
80 old.get(path, {}).get("data", {}),
81 new.get(path, {}).get("data", {}),
82 with_unchanged,
83 )
84 if path_diff:
85 res[path] = path_diff
86 return dict(res)
87
88
89def format_dict(d):

Callers

nothing calls this directly

Calls 5

dictClass · 0.85
keysMethod · 0.80
_diffFunction · 0.70
updateMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…