5 Commits
Author SHA1 Message Date
dualfroz 726a0aaf2d Describe this repository 2026-10-22 21:06:52 +02:00
dualfroz 1476898aa3 fix: only normalize values for hashing with operators that match
DeepHash._hash ran normalize_value_for_hashing of every registered custom
operator on every value, without ever consulting the operator's match method.
An operator scoped to one type therefore rewrote values of every other type.

When such an operator returns None for the values it was never meant to see,
all of those values hash to the same thing and unequal iterables compare as
equal under ignore_order=True: [1, 2] and [2, 3] were reported as identical.

Ask the operator whether it applies before normalizing. DeepHash walks a single
object at a time and has no t1/t2 pair, so the value is passed to match as both
sides via a small level-like view, which keeps operators scoped by type or by
path behaving as they do while diffing. Operators that define no match method
are still applied to everything.

Fixes #606
2026-09-03 14:17:11 +02:00
upstream 25afc42a2c Upstream seperman/deepdiff state of the touched files before a416378437 2026-09-03 14:17:11 +02:00
dualfroz 4179793c2b fix: count exclude_regex_paths towards threshold_to_diff_deeper
The shortcut in _diff_dict that reports a whole dictionary as a single
values_changed entry compensates its key count for exclude_paths and
exclude_glob_paths, but never for exclude_regex_paths.

Regex-excluded keys are not removed from the key sets beforehand either,
since _skip_this_key only filters on include_paths and include_glob_paths.
They therefore inflate the key union, drag the ratio of shared keys under
the threshold and trigger the shortcut, so the exclusion is silently
ignored and the excluded keys leak into old_value and new_value.

Filter the key union by exclude_regex_paths as well, mirroring the
exclude_glob_paths branch and using search() to match how _skip_this
applies the same patterns.

Fixes #487
2026-09-03 14:06:34 +02:00
upstream aa2b15b1b3 Upstream seperman/deepdiff state of the touched files before f9aea3e22e 2026-09-03 14:06:34 +02:00