-
-
Notifications
You must be signed in to change notification settings - Fork 235
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
bug when ignore_string_case=True #515
Comments
Same issue probably. When setting ignore_string_case=True, all the keys in the deepDiff results become lowercase. This issue leads to a failed comparison when there are the keys that are case sensitive in json files. Please be realized that it seems only affects the comparison for the string value. For the other keys with other value types, the comparison still works. Please refer to the attached json files and the parameters I set, and output for your reference. function call: diff = DeepDiff(json1, json2, exclude_paths=exclude_path_list, exclude_regex_paths=exclude_path_reg_list, ignore_string_case=True, verbose_level=2) exclude_path_list=["root['headers']['uploadedOn']", "root['headers']['path']", "root['headers']['uploadedBy']", "root['headers']['timestamp']", "root['headers']['version']", "root['calibration']['chksum']", "root['runs']['dateInUTC']", "root['runs']['dateOutUTC']", "root['runs']['client']", "root['runs']['WellboreDiameter']", "root['performance_metrics']"] expected output: {} |
@jbones001 @watercloset128 What we can do is to cache a dictionary or the lower case key to one of the ways it appears in your data. And then when we report the key, we show you one of those ways. Does that make sense? Your What do you think? |
@seperman no matter which way you mentioned, I would prefer to keep the key case sensitive exactly as it is while comparing its string value with ignoring the case sensitivity. Because, from a developer or a DeepDiff "user" perspective, it would be preferable in the more intuitive way, which is simply to take the key from the file to be compared and check the values from the key as it is by the user set. So, when you mentioned that So, I would prefer the better way I mentioned above if there is a possibility to make it. However, I am not quite sure if it's quite challenging to implement it. The bottom line, from my understanding, the way of using exclude_path_list below will work while the key in Anyway, appreciate your effort on fixing the issues! Even with those being said, I am quite satisfied with DeepDiff that I can compare json files in a clear and intuitive way without taking too much care of complex parameters in the most cases. exclude_path_list=["root['headers']['uploadedOn']", "root['headers']['path']", "root['headers']['uploadedBy']", "root['headers']['timestamp']", "root['headers']['version']", "root['calibration']['chksum']", "root['runs']['dateInUTC']", "root['runs']['dateOutUTC']", "root['runs']['client']", "root['runs']['WellboreDiameter']", "root['performance_metrics']"] |
I agree with @watercloset128 |
When setting ignore_string_case=True, all the keys in the deepDiff results become lowercase. This is an issue if using the key names to display to the user and you want the original case preserved
The text was updated successfully, but these errors were encountered: