We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Describe the bug If two instances are used in a comparison, where:
__slots__
ignore_type_in_groups
Then an unprocessed result is returned.
unprocessed
To Reproduce
from bson import ObjectId # pymongo class MyObjectId(ObjectId): pass oid = 'deadbeef1234deadbeef1234' o1 = ObjectId(oid) o2 = MyObjectId(oid) DeepDiff(o1, o2, ignore_type_in_groups[(ObjectId, MyObjectId)])
Expected behavior An empty DeepDiff object is returned
OS, DeepDiff version and Python version (please complete the following information):
Additional context bson.ObjectId is imported from PyMongo 4.10.1
bson.ObjectId
The text was updated successfully, but these errors were encountered:
Hi @chriswyatt Thanks for reporting the issue and the steps to reproduce. It does seem like an edge case. Looking into it!
Sorry, something went wrong.
I don't have MongoDB. When I pass the following code, it works correctly. Am I missing something here?
def test_custom_objects_slot_in_group_change(self): class ClassA: __slots__ = ('x', 'y') def __init__(self, x, y): self.x = x self.y = y class ClassB(ClassA): pass t1 = ClassA(1, 1) t2 = ClassB(1, 1) ddiff = DeepDiff(t1, t2, ignore_type_in_groups=[(ClassA, ClassB)]) result = {} assert result == ddiff
Hi @seperman . Thanks for taking a look. The slots need to contain a mangled attribute, i.e. an attribute with 2 leading underscores.
You can also see it in the ObjectId source code: https://github.com/mongodb/mongo-python-driver/blob/master/bson/objectid.py
seperman
No branches or pull requests
Describe the bug
If two instances are used in a comparison, where:
__slots__
ignore_type_in_groups
Then an
unprocessed
result is returned.To Reproduce
Expected behavior
An empty DeepDiff object is returned
OS, DeepDiff version and Python version (please complete the following information):
Additional context
bson.ObjectId
is imported from PyMongo 4.10.1The text was updated successfully, but these errors were encountered: