pxf: cpp pin to v0.75.0 + Result.directives/tables + validate_descriptor#6
Merged
Merged
Conversation
First PR of the Python v0.72-v0.75 catch-up. The sibling cpp port shipped its v0.72-series feature set on v0.75.0 (PRs #9 / #11 / #12 / #13 / #14). This PR bumps the CI cpp pin from the pre-v0.72 commit 9af2ec0 to the v0.75.0 tag and exposes the new pxf surface through the nanobind FFI. Python surface additions (in src/protowire/pxf.py): - pxf.Result gains `directives: tuple[Directive, ...]` and `tables: tuple[TableDirective, ...]`, populated by `unmarshal_full`. Backward compat: existing set_paths / null_paths / is_set / is_null / is_absent / null_fields unchanged. - pxf.Directive(name, prefixes, type, body, has_body, line, column) is a frozen dataclass. body is the verbatim bytes between `{` and `}`; type keeps v0.72.0 single-prefix back-compat. - pxf.TableDirective(type, columns, rows) with cells modeled as None (absent) or (kind, value) 2-tuples. kind ∈ {null, string, int, float, bool, bytes, ident, timestamp, duration} — faithful to the three-state cell grammar (draft §3.4.4). - pxf.validate_descriptor(msg) → list[Violation] for the schema reserved-name check (draft §3.13). - pxf.Violation(kind, element, name, file) frozen dataclass. - skip_validate keyword on unmarshal / unmarshal_full and their _bytes variants. FFI (src/_protowire/module.cc): - PxfValidateDescriptor returns list of (kind, element, name, file) tuples that pxf.py wraps into Violation dataclasses. - PxfUnmarshalFull now returns 5 elements: bytes, set_paths, null_paths, directives, tables. Cells are marshalled as either nb::none() (absent) or (kind, value) tuples via the visit-based CellToPyTuple helper. - skip_validate plumbed through PxfUnmarshal and PxfUnmarshalFull. Tests (16 new in tests/test_pxf_directives.py, 62 total): - Result.directives / Result.tables across all shapes - Three-state cells, multi-table, directive+table coexistence - validate_descriptor against the conformant test schema - skip_validate happy path - Violation dataclass shape + frozen-instance check
This was referenced May 12, 2026
Merged
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
First of three PRs in the Python v0.72–v0.75 catch-up. The sibling `protowire-cpp` shipped its v0.72-series feature set on v0.75.0 (cpp PRs #9 / #11 / #12 / #13 / #14). This PR:
PR 2 will add `TableReader` streaming + `bind_row` (the iterator-protocol piece). PR 3 will cut v0.75.0.
Test plan