Skip to content

Preserve dictionary key casing in case-insensitive diff paths - #630

Open
saitakarcesme wants to merge 1 commit into
qlustered:devfrom
saitakarcesme:codex/preserve-dictionary-key-casing
Open

saitakarcesme wants to merge 1 commit into
qlustered:devfrom
saitakarcesme:codex/preserve-dictionary-key-casing

Conversation

@saitakarcesme

Copy link
Copy Markdown

With ignore_string_case=True, comparing {"User": {"AboutMe": 1}} and {"user": {"aboutme": 2}} reports a path using lowercase keys that do not exist in the first input. exclude_paths and exclude_regex_paths using the original keys consequently fail to exclude the change.

Keep case-normalized keys for matching, but use each input's original string key for its tree relationship. This preserves case-insensitive key matching and exposes the second input's spelling through path(use_t2=True). Numeric and bytes key normalization retain their existing behavior. Reported paths now use original casing, so callers depending on lowercase output paths should update their expectations.

Fixes #515.

Validation: the original-path and exclusion regressions failed before the fix. Full suite: 1,276 passed, 44 skipped, one pre-existing macOS resource.setrlimit(RLIMIT_AS) failure reproduced on the unchanged base. Pyright's 50 existing diagnostics and flake8 diagnostics match the unchanged base after accounting for line shifts. git diff --check passes.

Disclosure: implemented and tested using OpenAI Codex in an authorized automated contribution session.

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

Successfully merging this pull request may close these issues.

1 participant