Fix numeric formatting of temporal dictionary keys - #624
Open
be-student wants to merge 1 commit into
Open
Conversation
Keep temporal objects out of numeric rounding at the shared formatter. Cover direct and unordered dictionary comparison, distinct temporal keys, and formatting precision while preserving numeric behavior. Fixes: qlustered#550
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fix the
TypeErrorraised when date/time objects are dictionary keys and key-cleaning options route them through numeric formatting.number_to_string()now uses the existingonly_numbersgroup; temporal objects pass through unchanged instead of reachinground(). Broad comparison dispatch still uses the existingnumbersgroup.Fixes #550.
The same guard correction was proposed in the closed #599; #615 proposed an equivalent temporal early return. Both attempts were closed by their authors without a recorded maintainer rejection. This contribution revalidates the current
devbranch and adds broader regression coverage.Validation
--runslow: 1,375 passed, 8 skipped, 1 failed, 95% coverage. The unchangedtest_restricted_unpickler_memory_exhaustion_cvefails atresource.setrlimit(RLIMIT_AS)on macOS, before unpickling. The same failure was reproduced on the untouched base commit using the same environment; no security test or memory-limit changes are included.deepdiff/helper.py: zero errors/warnings. CI's blocking Flake8 selection andgit diff --checkpassed.Audited callers include ordinary/grouped dictionary-key cleaning, DeepHash numeric dispatch, scalar comparison, and complex-number formatting. Existing numeric rounding, temporal comparison/truncation, and normalized key-label behavior are preserved. No persistent-data migration is needed.
AI assistance: OpenAI Codex (GPT-6), local implementation, tests, and review. Hosted Linux/Python matrix results remain pending.