Repository navigation
test(semantic-types): stabilize Arrow fixture identities across Python versions - #676
Conversation
|
No actionable comments were generated in the recent review.
|
| Layer / File(s) | Summary |
|---|---|
Assign stable identities to synthetic dataclasses tests/test_semantic_types/test_narrow_float_arrow_compatibility.py, changelog.d/ITL-1591.md |
A helper sets each dataclass’s __module__ to the test module. The newer-class and missing-class cases use the helper. The changelog notes the identity consistency across supported Python versions. |
Estimated code review effort: 1 (Trivial) | ~5 minutes
Change: Other
Possibly related PRs
- metamorphic-labs/orcapod-python#643: This PR updates the Arrow compatibility test and changelog entry introduced by
#643.
Merge Risk: 
Minimal · up to 9fa89
-
This change only stabilizes test fixture identities across Python versions and adds a changelog note. It does not change product behavior, and no merge-blocking risk was identified.
Security architecture risk: 
Minimal · up to 9fa89
-
The change gives test fixtures consistent class names across Python versions without changing how production code handles Arrow input.
Pre-merge checks: 
4
-
Full details: Title check
-
Explanation
The title "test(semantic-types): stabilize Arrow fixture identities across Python versions" matches the changeset. The PR gives each synthetic dataclass in the Arrow narrow-float compatibility test an explicit module identity through a new
_snapshot_dataclasshelper. This removes the Python 3.11 versus 3.12/3.13 difference in__module__formake_dataclassclasses. The title is short, specific, and names the main change.
-
Finishing Touches
-
Generate unit tests (beta)
-
- Commit to this branch
- Create a new PR
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Usage-based review receipt
- Mode: Review on demand
- Reviewed files: 2
- Charged: $0.50
- View usage details
Note
This review was completed with usage-based billing: files reviewed beyond your plan's included limits are billed at $0.25/file. View usage-based billing.
Cause
This is case (b), a test-fixture issue. Python 3.11 preserves the module passed in
make_dataclass(namespace=...). Python 3.12 and 3.13 overwrite it with the caller's module when themoduleargument is omitted. Orcapod correctly includes the module-qualified name of an exact dataclass in its Arrow extension identity.Tracing the writer's serialized Arrow extension metadata before the IPC round trip showed these differing
identity.nameinputs:Entriesitl1591_arrow_compatibility.Entriestests.test_semantic_types.test_narrow_float_arrow_compatibility.EntriesOuteritl1591_arrow_compatibility.Outertests.test_semantic_types.test_narrow_float_arrow_compatibility.OuterInneritl1591_arrow_compatibility.Innertests.test_semantic_types.test_narrow_float_arrow_compatibility.InnerThe recorded field tokens were identical, including
dict[str, int],dict[numpy.float32, int], andset[numpy.float32]. For the synchronous Arrow replacement-class case, the pipeline hash started withf8ea489bon 3.11 and023b1ebbon 3.12 and 3.13. The same identity difference affected the source content hash and row data hash. Rows, data, and tag hashes matched.Fix
Assign the module name embedded in the existing snapshot after creating each synthetic dataclass. This restores the three affected fixtures' pipeline, content, and data hashes on Python 3.11. The existing snapshot and golden hashes are preserved.
Verification
Summary by CodeRabbit