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

Floating point imprecision causes different dicts to be marked as similar if highly nested #56

Open
nagrawal-eightfold opened this issue Feb 10, 2023 · 0 comments

Comments

@nagrawal-eightfold
Copy link

Either we should migrate to integer only arithmetic OR use python decimal library to increase precision

I have a usecase where JSON schema are being marked similar if the difference is at deepest level in a fairly nested schema.

Alternatively instead of using similarity score < 1 to check for similarity we should maybe change criteria to be that returned diff is not empty?

                d, s = self._obj_diff(v, w)
                if s < 1.0:
                    changed[k] = d

i.e this code may need to change to instead check based on d instead of s

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants