Repository navigation
Fix signed integer selection for variant unions - #11286
RanaPriyansh wants to merge 1 commit into
Conversation
|
fyi @klion26 since you raised original comment |
|
Thank you for your interest in contributing to arrow-rs. I am closing this PR because it matches the pattern of submissions covered by our AI generated submissions policy: a high volume of PRs across many repositories, opened very shortly after issues are filed, where it is not clear that the author is able to debug and own the changes themselves. I am sorry if this isn't AI spam, but we are being overwhelmed with such PRs and won't have time to review these. Maintainer review time is the scarcest resource in this project, and we need to spend it on contributions where the author can work through the review with us. If you would like to contribute in the future, please pick a single issue, make sure you fully understand the change and can respond to review comments, and open one PR at a time. |
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 scalarvariant_getconverts 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.