GeezerVison is showing github.com — DeepDiff not excluding paths when ignore_order is True · Issue #174 · qlustered/deepdiff
DeepDiff not excluding paths when ignore_order is True #174DescriptionDescribe the bug
When attempting to do a diff between two lists of dictionaries, if ignore_order is defined as True, and exclude_paths is provided, the exclude_paths appears to not be accounted for.
To Reproduce
Steps to reproduce the behavior:
- Here is the following code snippet I have been using to reproduce the error:
from deepdiff import DeepDiff
obj1 = {'a': 1, 'b': 'randomString', 'e': "1111"}
obj2 = {'c': 1, 'd': 'randomString', 'e': 'Cool'}
obj1a = {'a': 1, 'b': 'randomString', 'e': "2222"}
obj2a = {'c': 1, 'd': 'randomString', 'e': 'Cool'}
test1 = [obj1, obj2]
test2 = [obj2a, obj1a]
exclude_paths = ["root[0]['e']", "root[1]['e']"]
print(DeepDiff(test1, test2, ignore_order=True, report_repetition=True, verbose_level=2, exclude_paths=exclude_paths))
- Run the above script
- Result will show be:
{'iterable_item_added': {'root[1]': {'a': 1, 'b': 'AaPedDefault', 'e': '2222'}}, 'iterable_item_removed': {'root[0]': {'a': 1, 'b': 'AaPedDefault', 'e': '1111'}}}
- If you change the
e field of obj1a to be the same as obj1['e'], DeepDiff will return an empty object, as expected.
Expected behavior
Output of the above should show no diff, as e should be excluded from the paths.
Expected output:
OS, DeepDiff version and Python version (please complete the following information):
- OS: CentOs7
- DeepDiff Version: 4.2.0
- Python Version: Python 3.6.5
Activitybenediktbrandt commented on Feb 17, 2020 We are seeing the same issue with DeepDiff 4.0.9 daaain commented on Mar 3, 2020 Just ran into this, still happening with 4.2.0 seperman commented on Mar 10, 2020 Hi @bbushnell95
Thanks for reporting the issue.
Let me take a look at it. Reacted by Daniel Demmel and Brett Bushnell seperman commented on Mar 11, 2020 Reacted by Daniel Demmel Reacted by Brett Bushnell
MetadataMetadataDevelopmentNo branches or pull requestsIssue actions
|