RanaPriyansh opened a new pull request, #11286: URL: https://github.com/apache/arrow-rs/pull/11286
# Which issue does this PR close? Related to #10905. This fixes signed-integer union selection; broader numeric conversion parity remains outside this change. # Rationale for this change `Variant::Int64(1)` cannot select a single Int8 union child, although scalar `variant_get` converts it to Int8. Equal signed integers can also select different children when their stored types differ. # What changes are included in this PR? Select the smallest signed integer child that holds the value exactly. Declaration order resolves equal-rank ties. Selection occurs before one append to the chosen child. Other variant types retain their existing ranking. # Are these changes tested? Tests cover explicit Int8, Int16, Int32, and Int64 tags for the same value, both union modes, a larger child declared first, nondefault type IDs, Int8 boundaries, nulls, strict cast errors, and encoded children. All three focused regressions fail on the unmodified base. With the change, 371 affected-crate unit tests and 15 doctests pass. Workspace formatting and spelling checks pass. The affected crate passes Clippy with all targets, all features, and warnings denied. # Are there any user-facing changes? Signed integers can select a narrower union child when the value fits. Equal integer values select the same child regardless of their stored width. Public API signatures are unchanged. The selector documentation reflects this behavior. Codex used. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
