deepdiff icon indicating copy to clipboard operation
deepdiff copied to clipboard

deepdiff with include-paths is changing results, if a not considered path changes

Open jlaba opened this issue 1 year ago • 0 comments

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

jlaba avatar Oct 10 '24 15:10 jlaba