You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Comparing some paths of two dicts with deepdiff the results differ, depending on the presence or absence of other "not included" paths (see also Stackoverflow question).
from deepdiff import DeepDiff
DeepDiff(
{
'name': 'Testname',
'code': 'bla',
'noneCode': 'blu',
}, {
'uid': '12345',
'name': 'Testname',
},
include_paths = "root['name']"
) # expected to be {}, but detects a change
DeepDiff(
{
'name': 'Testname',
'code': 'bla',
}, {
'uid': '12345',
'name': 'Testname',
},
include_paths = "root['name']"
) # expected to be {} and is {}
OS, DeepDiff version and Python version (please complete the following information):
OS: OpenSuSe Leap 15.6 as well as Windows 11
Python Version 3.10 (on linux), 3.11 (on windows)
DeepDiff Version 8.0.1
The text was updated successfully, but these errors were encountered:
@jlaba Thanks for reporting the bug.
We should switch our "include_path" logic so it first does the full diff, then it removes any reports that are outside the include_paths.
So I'm not an expert in performance, but most likely in larger dicts, it might be good to only walk through the paths, which should be compared to speed up the process. I had a quick check at the code and most likely this line
is the issue. My thesis is, that the problem occurs, because I have not included all root elements. I will try to build a test for it, to check whether the thesis is true :-)
So my thesis proofed to be wrong. The problem is, if the number of items in a dict is changing, even if those added or removed items are not in the included path.
Comparing some paths of two dicts with deepdiff the results differ, depending on the presence or absence of other "not included" paths (see also Stackoverflow question).
OS, DeepDiff version and Python version (please complete the following information):
The text was updated successfully, but these errors were encountered: