We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Describe the bug When using group_by using a key which is nullable, it cannot do group_by on None, because of this line in diff.py
group_by
diff.py
if self.ignore_string_case: clean_key = clean_key.lower()
AttributeError: 'NoneType' object has no attribute 'lower'
To Reproduce
from deepdiff import DeepDiff # First dictionary dict1 =[{'txt_field': 'FULL', 'group_id': None}] # Second dictionary with some differences dict2 = [{'txt_field': 'FULL', 'group_id': 'a'}] # Compare the dictionaries diff = DeepDiff( dict1, dict2, ignore_order=True, group_by='group_id', ignore_numeric_type_changes=True, significant_digits=1, ignore_string_case=True, ignore_nan_inequality=True, ) print("Differences found:", diff)
Expected behavior If the group_by key is None, it should group_by all None/NULL fields where the group_by key is instance of string.
if self.ignore_string_case and isinstance(clean_key,str): clean_key = clean_key.lower()
OS, DeepDiff version and Python version (please complete the following information):
The text was updated successfully, but these errors were encountered:
Successfully merging a pull request may close this issue.
Describe the bug
When using
group_by
using a key which is nullable, it cannot do group_by on None, because of this line indiff.py
AttributeError: 'NoneType' object has no attribute 'lower'
To Reproduce
Expected behavior
If the group_by key is None, it should group_by all None/NULL fields where the group_by key is instance of string.
OS, DeepDiff version and Python version (please complete the following information):
The text was updated successfully, but these errors were encountered: