You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
normalize_value_for_hashing methods are used from all registered operators #606
Describe the bug normalize_value_for_hashing method is not custom operator scoped, so that all normalize_value_for_hashing methods from all registered operators are invoked during comparison, ignoring match method result.
To Reproduce
Create custom operator.
Implement match method so that it returns True on comparisons of str only.
Implement normalize_value_for_hashing any way so that you can set a breakpoint inside. (or add print)
Compare two lists of integers with ignore_order = True in debug mode (so that match method returns False).
Code stops in normalize_value_for_hashing method.
Expected behavior
Since the operator should not be used in case of comparison of integers, normalize_value_for_hashing method from the operator should not be invoked.
Additional info:
Because of this behavior, if registered comparator has normalize_value_for_hashing with pass inside, comparison of lists is fully incorrect. E.g. [1, 2], [2, 3] - these lists are assumed as identical by deepdiff, even though the comparator above shouldnt have been invoked.
OS, DeepDiff version and Python version (please complete the following information):
Activity