seperman/deepdiff

max_diffs doesn't use ignore_nan_inequality flag

ohofherr opened this issue · 0 comments

Bug
When two arrays containing nan values are compared, the max_diffs flag is not working, when ignore_nan_inequality is set to true.

My use case of deepdiff is to compare very large Dicts with many long numpy arrays. I would like to stop as soon as one diff is detected. This is currently not possible.

To Reproduce

a = np.array([np.nan, np.nan, np.nan, np.nan, 1])
b = np.array([np.nan, np.nan, np.nan, np.nan, 2])

diff = DeepDiff(a, b, ignore_nan_inequality=True, max_diffs=2)
diff

Output:

DeepDiff has reached the max number of diffs of 2. You can possibly get more accurate results by increasing the max_diffs parameter.
{}

Expected behavior
There shouldn't be a warning what the max number of diffs is reached and one diff should be detected.

  • OS: [Rocky Linux 8]
  • Python Version 3.11.6
  • DeepDiff Version 6.6.1