Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

max_diffs doesn't use ignore_nan_inequality flag #433

Open
ohofherr opened this issue Nov 14, 2023 · 0 comments
Open

max_diffs doesn't use ignore_nan_inequality flag #433

ohofherr opened this issue Nov 14, 2023 · 0 comments

Comments

@ohofherr
Copy link

ohofherr commented Nov 14, 2023

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant