Skip to content
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

exclude_regex_paths does not work correctly with regular expressions including $ #471

Open
GroundWalker7 opened this issue Jul 8, 2024 · 0 comments

Comments

@GroundWalker7
Copy link

Describe the bug
The parameter exclude_regex_paths does not work correctly with regular expressions including $
When I check the source code, I found the following code in diff.py line 481:

elif self.exclude_regex_paths and any(
[exclude_regex_path.search(level_path) for exclude_regex_path in self.exclude_regex_paths]):
skip = True

and the level_path will be like root['createTime']
So, if I want to match paths ending with time when using exclude_regex_paths, I have to use (?i).*time']$ or something like that.

To Reproduce
DeepDiff({"aTimea": 1}, {"aTimea": 2}, exclude_regex_paths=["(?i).*time$"])
and still get diff: {'values_changed': {"root['aTimea']": {'new_value': 2, 'old_value': 1}}}

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

  • Python Version [3.12.2]
  • DeepDiff Version [7.0.1]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant