deepdiff
deepdiff copied to clipboard
exclude_regex_paths is not longer working with default threshold_to_diff_deeper
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
I face the same problem. Regex comportement with exclude_regex_paths has completely changed. Exemples shown in official documentation are not working in Python 3.12 I'm using DeepDiff Version [8.4.2]
@seperman I face the same problem.
php_data = {"main_category":[{"class":3,"article_id":70518358,"ID":453},{"class":2,"article_id":70518358,"ID":175},{"class":1,"article_id":70518358,"ID":163}]} go_data= {"main_category":[{"article_id":70518358,"ID":453},{"article_id":70518358,"ID":175},{"article_id":70518358,"ID":163}]}
diff = deepdiff.DeepDiff(php_data, go_data, exclude_regex_paths=r"root[main_category][\d+]['class']", ignore_order=True) diff return values_changed