Skip to content

fix: drop-in json compat, collection fidelity, naive datetime, NaN casing#101

Open
danielendler wants to merge 2 commits intomainfrom
fix/evaluation-bugs-and-ci
Open

fix: drop-in json compat, collection fidelity, naive datetime, NaN casing#101
danielendler wants to merge 2 commits intomainfrom
fix/evaluation-bugs-and-ci

Conversation

@danielendler
Copy link
Copy Markdown
Owner

Summary

Fixes all 5 bugs identified in the blackbox evaluation report (investigation/findings_report.md):

  • Drop-in json compatibility: dumps() now accepts indent, ensure_ascii, separators, skipkeys, allow_nan; loads() now accepts parse_float, parse_int, object_hook, etc. Config kwargs and json kwargs are cleanly separated.
  • tuple/set/frozenset round-trip fidelity: With include_type_hints=True (default), these types now serialize with __datason_type__ metadata and are correctly reconstructed on loads(). Without type hints, behavior is unchanged (serialized as list).
  • Naive datetime timezone mismatch: UNIX/UNIX_MS format now stores a tz_aware flag in type metadata. Naive datetimes round-trip as naive instead of becoming UTC-aware. Backward compatible — old payloads default to UTC.
  • NaN string capitalization: NanHandling.STRING now produces "NaN", "Infinity", "-Infinity" matching JSON5/JavaScript conventions.
  • CI action versions: upload-artifact@v6@v7 across all workflows (was mismatched with download-artifact@v7); mutation.yml actions updated; quality gate no longer downloads all ML libs just for linting.

Test plan

  • pytest tests/unit/ tests/integration/ — 632 tests pass
  • ruff check + ruff format --check — clean
  • pyright — 0 errors
  • All pre-commit hooks pass

🤖 Generated with Claude Code

danielendler and others added 2 commits March 21, 2026 20:35
- 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>
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