Skip to content

exclude_regex_paths is not longer working with default threshold_to_diff_deeper #487

@wreggyl

Description

@wreggyl

Describe the bug
The exclude_regex_paths is not working if the keys are different and would be filtered out. Only working if the threshold_to_diff_deeper is set to 0

To Reproduce
t1 = {'a': [1, 2, [3, {'foo1': 'bar'}]]}
t2 = {'a': [1, 2, [3, {'foo2': 'bar'}]]}
diff = deepdiff.DeepDiff(t1, t2, exclude_regex_paths="['foo.']")

Expected behavior
Diff is expected to be empty

OS, DeepDiff version and Python version (please complete the following information):

  • OS: [MAC OS, Windows]
  • Version [14.6.1, 11]
  • Python Version [3.12, 3.9.2]
  • DeepDiff Version [8.0.1]

Additional context
Example from:
https://zepworks.com/deepdiff/current/exclude_paths.html
diff = deepdiff.DeepDiff(t1, t2, exclude_regex_paths="['foo.']", threshold_to_diff_deeper=0) is working and produces empty diff

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions