GH-32852: [C++][Docs] Document float-to-decimal cast rounding behavior #55796
All Vouch review confidence checks passed
Residual risk 0.19 = Change Risk (0.35) × (1 − Review Confidence (0.47)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.35 · 170 lines diff across 2 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.02 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Shallow Review Depth
shallow_review_depth
0.344
Diff Size
diff_size
0.308
Real PR Conversation Timeline
1 comments
"Review active on #55796"
general
weight: 0.35
Sumdiboii
Rationale for this change
Casting floating-point values (
float/double) toDecimalalways rounds to the target scale viaDecimal::FromReal(RoundedRightShift), andCastOptions::allow_decimal_truncateonly controls whether errors are ignored when the converted value overflows the target precision or is non-finite. Documenting this clarifies whyCastOptions::safe()does not raise on fractional digits beyond the target scale.Closes #32852
What changes are included in this PR?
CastOptions::allow_decimal_truncateincpp/src/arrow/compute/cast.h.Decimalrounding andallow_decimal_truncatesemantics indocs/source/cpp/compute.rst(note 4 under Same-kind conversion).allow_decimal_truncateparameter description inpython/pyarrow/_compute.pyx.Are these changes tested?
Documentation-only change verified against
cpp/src/arrow/compute/kernels/scalar_cast_numeric.cc(RealToDecimal) andcpp/src/arrow/util/decimal.cc(FromReal), plus reStructuredText parsing viadocutils.Are there any user-facing changes?
Documentation updates only (no runtime behavior change).
Was AI used for this PR?