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

bug when ignore_string_case=True #515

Open
jbones001 opened this issue Dec 30, 2024 · 1 comment
Open

bug when ignore_string_case=True #515

jbones001 opened this issue Dec 30, 2024 · 1 comment

Comments

@jbones001
Copy link

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

@watercloset128
Copy link

watercloset128 commented Jan 29, 2025

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']"]
exclude_path_reg_list=["root\['toolset'\]\[\d+\]\['currentSiteHierarchy'\]", "root\['toolset'\]\[\d+\]\['siteHierarchy'\]", "root\['toolset'\]\[\d+\]\['description'\]", "root\['toolset'\]\[\d+\]\['partnumber'\]", "root\['toolset'\]\[\d+\]\['revisionlevel'\]"]

expected output: {}
actual output: {'values_changed': {"root['headers']['uploadedon']": {...}, "root['headers']['uploadedby']": {...}}}

1738172292455-impulse-results.json

baseline-results.json

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

2 participants