-
-
Notifications
You must be signed in to change notification settings - Fork 226
New issue
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
Error when comparing two nested dicts with 2 added fields #450
Comments
@AlejandroSantorum |
Dear @seperman, Thank you for the reply and apologies for the misunderstanding. Is there any way to get the paths of the added items pointing to Many thanks. |
No worries! There is a bug that the path for |
Thank you for your time. If you can post here a comment when the path in Appreciate it. |
Sure, I have fixed it for your case in the dev branch. I need to look into more examples. |
Describe the bug
DeepDiff
fails when 2 new fields are added int2
in different nested dictionary fields. The library identifies correctly the name of the new fields, but it is unable to retrieve the correct dictionary levels or paths to them.DeepDiff
works as expected when just a new field is added, but it breaks when 2 new fields are added in different levels.To Reproduce
Create two dictionaries to compare:
The
s2
dictionary contains two new fieldsGlobalId
atroot['fields'][1]
andPlayer2
atroot['fields'][3]['type']['fields'][2]
, but if I runI get:
Which is wrong for the second added field: the new field name is correctly identified, but the path within the dictionary is wrong, the path
root['fields'][2]['type']['fields'][2]
does not exist.Expected behavior
It should return the right dictionary path for the second added field, that is
root['fields'][3]['type']['fields'][2]
, i.e., the full correct output should be:OS, DeepDiff version and Python version (please complete the following information):
Additional context
None.
The text was updated successfully, but these errors were encountered: