Skip to content

Commit

Permalink
Merge pull request #480 from artemisart/patch-1
Browse files Browse the repository at this point in the history
Fix _dict_from_slots, solves Path comparison
  • Loading branch information
seperman authored Sep 12, 2024
2 parents 47d7816 + ce1c8fb commit a114ed2
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions AUTHORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,3 +63,4 @@ Authors in order of the timeline of their contributions:
- [sf-tcalhoun](https://github.com/sf-tcalhoun) for fixing "Instantiating a Delta with a flat_dict_list unexpectedly mutates the flat_dict_list"
- [dtorres-sf](https://github.com/dtorres-sf) for fixing iterable moved items when iterable_compare_func is used.
- [Florian Finkernagel](https://github.com/TyberiusPrime) for pandas and polars support.
- Mathis Chenuet [artemisart](https://github.com/artemisart) for fixing slots classes comparison.
2 changes: 1 addition & 1 deletion deepdiff/diff.py
Original file line number Diff line number Diff line change
Expand Up @@ -421,7 +421,7 @@ def unmangle(attribute):
else:
all_slots.extend(slots)

return {i: getattr(object, unmangle(i)) for i in all_slots}
return {i: getattr(object, key) for i in all_slots if hasattr(object, key := unmangle(i))}

def _diff_enum(self, level, parents_ids=frozenset(), local_tree=None):
t1 = detailed__dict__(level.t1, include_keys=ENUM_INCLUDE_KEYS)
Expand Down
2 changes: 1 addition & 1 deletion tests/test_diff_text.py
Original file line number Diff line number Diff line change
Expand Up @@ -1713,7 +1713,7 @@ def __str__(self):
t2 = Bad()

ddiff = DeepDiff(t1, t2)
result = {'unprocessed': ['root: Bad Object and Bad Object']}
result = {}
assert result == ddiff

def test_dict_none_item_removed(self):
Expand Down

0 comments on commit a114ed2

Please sign in to comment.