Skip to content

exclude_paths fails to work #509

@SpecLad

Description

@SpecLad

Describe the bug
Sometimes (I'm not sure what the exact conditions are) DeepDiff detects changes that should have been suppressed by exclude_paths.

To Reproduce
Run this:

from deepdiff import DeepDiff
dd = DeepDiff({}, {'foo': '', 'bar': ''}, exclude_paths=['foo', 'bar'])
print(dd)

It prints:

{'values_changed': {'root': {'new_value': {'foo': '', 'bar': ''}, 'old_value': {}}}}

Expected behavior
It should print:

{}

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

  • OS: Ubuntu
  • Version 22.04.5
  • Python Version 3.10.12
  • DeepDiff Version 8.0.1

Additional context
This is a regression that was introduced in release 8.0.0, and specifically in this commit: ff6ff87. Since there are no numeric values in this test case, and I didn't enable use_log_scale anyway, it doesn't seem like an intentional change.

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