-
-
Notifications
You must be signed in to change notification settings - Fork 228
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
Option for acknowledging item ordering #361
Comments
I see. Yes, DeepHash was originally designed to assist DeepDiff when ignore_order=True. We can add a parameter to it to disable this behavior when needed. PR’s are welcome!Sep DehpourOn Dec 15, 2022, at 4:58 AM, Ian Young ***@***.***> wrote:
I've noticed that the hash of an object is the same if a list contained in the object has items moved around. E.g.
obj1 = {"key": [{1: "one"},{2: "two"}]}
obj2 = {"key": [{2: "two"},{1: "one"}]}
Both of the above result in the same hash.
Strictly speaking this should be considered a change and should result in a different hash.
Describe the solution you'd like
I'd ideally like the default handling to acknowledge item ordering and result in a different hash value.
Describe alternatives you've considered
Failing it being the default handling, it would be good if there was an option to set item ordering acknowledgements, resulting in a different hash value.
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you are subscribed to this thread.Message ID: ***@***.***>
|
A parameter would be great, thanks! In my particular use case I have a dynamic list of images inside the dictionary and the first image in the list serves as the featured image. The featured image changes every now and then so I not only need to see if there are changes but changes of item order which are important to capture. |
Hi @ianyoung |
Awesome! Thanks for letting me know. |
I've noticed that the hash of an object is the same if a list contained in the object has items moved around. E.g.
Both of the above result in the same hash.
Strictly speaking this should be considered a change and should result in a different hash.
Describe the solution you'd like
I'd ideally like the default handling to acknowledge item ordering and result in a different hash value.
Describe alternatives you've considered
Failing it being the default handling, it would be good if there was an option to set item ordering acknowledgements, resulting in a different hash value.
The text was updated successfully, but these errors were encountered: