fix: drop-in json compat, collection fidelity, naive datetime, NaN casing#101
Open
danielendler wants to merge 2 commits intomainfrom
Open
fix: drop-in json compat, collection fidelity, naive datetime, NaN casing#101danielendler wants to merge 2 commits intomainfrom
danielendler wants to merge 2 commits intomainfrom
Conversation
- upload-artifact@v6 → @v7 in ci.yml, docs.yml, publish.yml (upload/download must match) - mutation.yml: checkout@v5 → @v6, setup-uv@v5 → @v7, upload-artifact@v4 → @v7 - quality job: uv sync --all-extras → uv sync (no ML libs needed for lint/typecheck) - test matrix: add 3.13 + all-extras entry (TF excluded by python_version marker) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Fixes all 5 bugs from the blackbox evaluation report:
1. Drop-in json.dumps/loads compatibility
- dumps() now accepts indent, ensure_ascii, separators, skipkeys, allow_nan
- loads() now accepts parse_float, parse_int, object_hook, etc.
- Datason config kwargs and json kwargs are correctly separated
2. tuple/set/frozenset type fidelity
- With include_type_hints=True (default), these types now round-trip
correctly via __datason_type__ metadata
- Without type hints, behavior unchanged (serialized as list)
3. Naive datetime timezone mismatch
- UNIX/UNIX_MS format now stores tz_aware flag in type metadata
- Naive datetimes round-trip as naive (not UTC-aware)
- Backward compatible: old payloads without tz_aware default to UTC
4. NaN string capitalization
- NanHandling.STRING now produces "NaN", "Infinity", "-Infinity"
- Matches JSON5 / JavaScript conventions
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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
Fixes all 5 bugs identified in the blackbox evaluation report (
investigation/findings_report.md):jsoncompatibility:dumps()now acceptsindent,ensure_ascii,separators,skipkeys,allow_nan;loads()now acceptsparse_float,parse_int,object_hook, etc. Config kwargs and json kwargs are cleanly separated.tuple/set/frozensetround-trip fidelity: Withinclude_type_hints=True(default), these types now serialize with__datason_type__metadata and are correctly reconstructed onloads(). Without type hints, behavior is unchanged (serialized as list).tz_awareflag in type metadata. Naive datetimes round-trip as naive instead of becoming UTC-aware. Backward compatible — old payloads default to UTC.NaNstring capitalization:NanHandling.STRINGnow produces"NaN","Infinity","-Infinity"matching JSON5/JavaScript conventions.upload-artifact@v6→@v7across all workflows (was mismatched withdownload-artifact@v7);mutation.ymlactions updated; quality gate no longer downloads all ML libs just for linting.Test plan
pytest tests/unit/ tests/integration/— 632 tests passruff check+ruff format --check— cleanpyright— 0 errors🤖 Generated with Claude Code