Skip to content

fix: dtype roundtrip guard#10

Merged
tylerriccio33 merged 4 commits into
mainfrom
dtype-roundtrip-guard
Jun 10, 2026
Merged

fix: dtype roundtrip guard#10
tylerriccio33 merged 4 commits into
mainfrom
dtype-roundtrip-guard

Conversation

@tylerriccio33

Copy link
Copy Markdown
Owner

Add more code to check if a dtype can roundtrip

Freeze the public contract so it can't change silently within a major
version:

- tests/contract/test_surface.py pins __all__ and the exact signature of
  every exported function.
- tests/contract/test_behavior.py freezes documented round-trips, dtypes,
  errors, the length-prefixed header shape, and the token wire format via
  a frozen golden token (cross-version decode stability).
- CONTRACT.md documents the SemVer promise and the append-only rule for
  tests/contract/.
Add --doctest-modules so the >>> examples in pl_row_encode's public
docstrings execute under pytest. This makes the documented usage a third
contract layer (alongside tests/contract/) and guarantees the examples
stay runnable. All 6 module doctests pass with no repr brittleness.
Replace the categorical-only denylist with an allowlist-based classifier:
known-good dtypes encode silently, Categorical is hard-rejected, and any
unvetted dtype emits a UserWarning that it may fail or panic on decode.
This keeps the encodable-implies-decodable invariant general without
maintaining an exhaustive denylist, while never running the dangerous
decode probe on an unknown type.
@tylerriccio33 tylerriccio33 merged commit a272366 into main Jun 10, 2026
11 checks passed
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