deepdiff icon indicating copy to clipboard operation
deepdiff copied to clipboard

There is a pattern of failure in uuid comparisons.

Open Masaya00 opened this issue 8 months ago • 1 comments

Thanks for creating a useful library. I appreciate it very much!

I'd like to report a point of concern I had while using it, just to be safe.

Describe the bug When using DeepDiff to compare sets containing uuid6.UUID objects, no differences are reported even when the sets have different numbers of elements. For example, comparing a set with one UUID versus a set with what appears to be two different UUIDs returns an empty diff. This behavior is unexpected because the additional element should be detected as a difference.

To Reproduce

import uuid6
from deepdiff import DeepDiff

_dummy_id_1: uuid6.UUID = uuid6.uuid7()
_dummy_id_2: uuid6.UUID = uuid6.uuid7()

diff = DeepDiff({_dummy_id_1}, {_dummy_id_1, _dummy_id_2})
print(diff)  # => {}
# Observe that the output is {}, indicating no differences detected.

Expected behavior DeepDiff should identify that the second set contains an additional element (i.e. _dummy_id_2 is not present in the first set) and return a diff that reflects this difference.

OS, DeepDiff version and Python version (please complete the following information):

  • Python Version 3.12
  • DeepDiff Version 8.4.2

Additional context I am using the uuid6 library, so maybe that could be the cause! Sorry if that's the case!

Masaya00 avatar Mar 28 '25 06:03 Masaya00

Hi @Masaya00 Thanks for reporting the issue. PRs are very welcome if you have time to fix it.

seperman avatar May 09 '25 18:05 seperman