pandas object uint64 export: preventing signed JSON identifiers from replacing originals
Identifier preservation requires comparison with the source sign and exact decimal representation, not just a range check.
pandas object uint64 export: preventing signed JSON identifiers from replacing originals
Equal scalar identifier values do not establish that object and explicitly typed uint64 containers use the same JSON path. Serializing the same original identifier through both representations helps identify which path to withhold, beyond merely detecting a sign-contract violation. Final acceptance still requires preservation of the source sign and exact decimal representation. [1, 2, 3]
What the primary source establishes
A pandas report describes a numpy uint64 held in an object-dtype Series taking a signed int64 serialization path and wrapping negative. A Series explicitly using uint64 preserves the positive value in the report's control. [1]
The handover decision
Place the same original ID in an object Series and an explicitly typed uint64 Series, then serialize both with identical JSON options. Link source_id_decimal, container_dtype, and exported_id_decimal by original row identity to determine whether only the object path changes the sign. Recheck the reported typed control on the actual version and options rather than treating it as a universal workaround. Reconcile IDs used by external references with the original decimal-string ledger; do not guess corrections for negative outputs. Regenerate the exchange file from raw values through a verified path, then reconcile consumer-decoded identifiers and affected references with the ledger. Choosing a dtype alone does not complete the repair. [1, 3]
A reference defined before the output
The illustrative identifier is defined as the positive integer 9223372036854775808. Its normal decimal text is 9223372036854775808; -9223372036854775808 fails that identity contract. This uses exact identifier-string comparison rather than arithmetic, so the test does not depend on a floating-point representation of the value. [1, 3]
The scoped Truthound check
Truthound Core 3.3.2 can compare source and exported identifiers prepared as exact string columns with ColumnPairValidator. Verify separately whether the business identifier contract excludes negative values. Determining how to repair external references requires both this comparison and the original ledger. [1, 2, 3]
Limits and alternative choices
Negative identifiers are not universally invalid, and broken references cannot be repaired without reconciling the ledger. If the exchange schema permits it, export identifiers as decimal strings and specify consumer parsing explicitly. A signed identifier field that legitimately permits negatives needs a different admission rule. [1, 3]
Application conditions
Preserve original and exported identifiers as exact decimal strings linked by source record identity. Compare object and explicitly typed uint64 containers using identical original IDs and JSON options, recording the version.
Alternatives
If the exchange schema permits it, export identifiers as decimal strings and specify consumer parsing explicitly.
Limitations
Negative identifiers are not universally invalid, and broken references cannot be repaired without reconciling the ledger.
Evidence
- Event checked
- Subject checked
- Modified
