kosiew opened a new pull request, #7887:
URL: https://github.com/apache/arrow-rs/pull/7887

   # Which issue does this PR close?
   
   Closes #7886.
   
   # Rationale for this change
   
   The existing decimal-to-float casting logic assumes infallible conversions, 
which may cause panics or incorrect results when the underlying conversion 
fails (e.g., when casting large `Decimal256` values to `f64`). By propagating 
errors properly, this change improves robustness and safety.
   
   # What changes are included in this PR?
   
   - Updated the decimal-to-float casting function signatures to return 
`Result` instead of direct values.
   - Replaced `.unary()` with `.try_unary()` to handle potential conversion 
errors.
   - Modified closures used in `cast_with_options` and `cast_from_decimal` to 
return `Result`.
   - Added a unit test for `Decimal256` to `f64` conversion that checks for 
overflow and ensures an appropriate error is returned.
   - Updated `parquet-testing` submodule to latest commit.
   
   # Are there any user-facing changes?
   
   Yes.
   
   - Users casting from `Decimal256` to `f64` may now receive an explicit error 
instead of encountering a panic or invalid result if the value exceeds 
representable bounds.
   - This improves safety and predictability but may result in casting failures 
where none were previously surfaced.
   


-- 
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: github-unsubscr...@arrow.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to