iUjjwalRaj opened a new pull request, #55796: URL: https://github.com/apache/arrow/pull/55796
### Rationale for this change Casting floating-point values (`float` / `double`) to `Decimal` always rounds to the target scale via `Decimal::FromReal` (`RoundedRightShift`), and `CastOptions::allow_decimal_truncate` only controls whether errors are ignored when the converted value overflows the target precision or is non-finite. Documenting this clarifies why `CastOptions::safe()` does not raise on fractional digits beyond the target scale. Closes #32852 ### What changes are included in this PR? - Documented `CastOptions::allow_decimal_truncate` in `cpp/src/arrow/compute/cast.h`. - Clarified floating-point to `Decimal` rounding and `allow_decimal_truncate` semantics in `docs/source/cpp/compute.rst` (note 4 under Same-kind conversion). - Updated the `allow_decimal_truncate` parameter description in `python/pyarrow/_compute.pyx`. ### Are these changes tested? Documentation-only change verified against `cpp/src/arrow/compute/kernels/scalar_cast_numeric.cc` (`RealToDecimal`) and `cpp/src/arrow/util/decimal.cc` (`FromReal`), plus reStructuredText parsing via `docutils`. ### Are there any user-facing changes? Documentation updates only (no runtime behavior change). ### Was AI used for this PR? - [x] AI (used for researching the cast kernel implementation and drafting the documentation text; all files and behavior were manually verified). -- 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]
