edponce commented on code in PR #12660:
URL: https://github.com/apache/arrow/pull/12660#discussion_r852090461
##########
cpp/src/arrow/compute/kernels/scalar_arithmetic_test.cc:
##########
@@ -2004,21 +2004,19 @@ TEST_F(TestUnaryArithmeticDecimal,
RoundToMultipleTowardsInfinity) {
set_multiple(ty, 1);
CheckScalar(func, {values}, values, &options);
set_multiple(ty, 0);
- CheckRaises(func, {ArrayFromJSON(ty, R"(["99.99"])")},
- "Rounding multiple must be positive", &options);
+ CheckRaises(func, {values}, "Rounding multiple must be positive",
&options);
+ options.multiple =
+ std::make_shared<Decimal128Scalar>(Decimal128(0), decimal128(4, 2));
+ CheckRaises(func, {values}, "Rounding multiple must be positive",
&options);
set_multiple(ty, -10);
CheckRaises(func, {ArrayFromJSON(ty, R"(["99.99"])")},
"Rounding multiple must be positive", &options);
set_multiple(ty, 100);
CheckRaises(func, {ArrayFromJSON(ty, R"(["99.99"])")},
"Rounded value 100.00 does not fit in precision", &options);
options.multiple = std::make_shared<DoubleScalar>(1.0);
- CheckRaises(func, {ArrayFromJSON(ty, R"(["99.99"])")}, "scalar, not
double",
- &options);
- options.multiple =
- std::make_shared<Decimal128Scalar>(Decimal128(0), decimal128(3, 0));
- CheckRaises(func, {ArrayFromJSON(ty, R"(["99.99"])")}, "scalar, not
decimal128(3, 0)",
- &options);
+ CheckRaises(func, {ArrayFromJSON(ty, R"(["99.99"])")},
+ "Rounded value 100.00 does not fit in precision", &options);
Review Comment:
Added two successful
([here](https://github.com/apache/arrow/pull/12660/files#diff-670d19cdae75caec7c47902285bf28449b6f188eddfb3a366ada22f3d7fe98b5R2075)
and
[here](https://github.com/apache/arrow/pull/12660/files#diff-670d19cdae75caec7c47902285bf28449b6f188eddfb3a366ada22f3d7fe98b5R2006))
Decimal cases, where `multiple` is set initially with a different Decimal type
than input.
--
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]