hcrosse opened a new pull request, #1503:
URL: https://github.com/apache/arrow-go/pull/1503

   ### Rationale for this change
   
   Casting `bool`, `decimal128` and `decimal256` to `int16` can return wrong 
values or reject values that fit.
   
   ### What changes are included in this PR?
   
   `cast_int16` now uses `kernels.GetCastToInteger[int16]` instead of 
`kernels.GetCastToInteger[int8]`. The boolean and decimal kernels use this type 
parameter for writes and decimal bounds checks.
   
   ### Are these changes tested?
   
   `TestBooleanToNumber` checks boolean casts to the eight integer types, 
`float32` and `float64`, including nulls. The expanded `TestDecimal128ToInt` 
and `TestDecimal256ToInt` check `int16` values and bounds, which their existing 
cases missed.
   
   The new `int16` success cases fail on main and pass with this change. The 
bounds rejection cases pass on both. The issue's reproduction prints `[1 0 1 
1]` and `[200 -300]` without errors with this change.
   
   `go test -tags assert,test ./arrow/...` with arrow-testing and 
parquet-testing checked out, `-race -tags assert,test` runs for compute and 
scalar, vet, lint and the Release Audit Tool passed with Go 1.26.10.
   
   ### Are there any user-facing changes?
   
   Yes. These casts return correct `int16` values and reject values outside its 
range with safe options. There is no API change.
   
   Closes https://github.com/apache/arrow-go/issues/1502.
   


-- 
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]

Reply via email to