Skip to content

There is a pattern of failure in uuid comparisons. #535

Open
@Masaya00

Description

@Masaya00

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!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions