js8544 commented on code in PR #36289:
URL: https://github.com/apache/arrow/pull/36289#discussion_r1276113170
##########
docs/source/cpp/compute.rst:
##########
@@ -563,30 +563,32 @@ representation based on the rounding criterion.
+-------------------+------------+-------------+-------------------------+----------------------------------+--------+
| floor | Unary | Numeric | Float32/Float64/Decimal |
| |
+-------------------+------------+-------------+-------------------------+----------------------------------+--------+
-| round | Unary | Numeric | Float32/Float64/Decimal |
:struct:`RoundOptions` | (1)(2) |
+| round | Unary | Numeric | Input Type |
:struct:`RoundOptions` | (1)(2) |
+-------------------+------------+-------------+-------------------------+----------------------------------+--------+
-| round_to_multiple | Unary | Numeric | Float32/Float64/Decimal |
:struct:`RoundToMultipleOptions` | (1)(3) |
+| round_to_multiple | Unary | Numeric | Input Type |
:struct:`RoundToMultipleOptions` | (1)(3) |
Review Comment:
Done
##########
cpp/src/arrow/compute/kernels/scalar_round_arithmetic_test.cc:
##########
@@ -1052,7 +1118,56 @@ TYPED_TEST(TestUnaryRoundUnsigned, Round) {
this->SetRoundMode(RoundMode::HALF_TOWARDS_INFINITY);
for (const auto& pair : ndigits_and_expected) {
this->SetRoundNdigits(pair.first);
- this->AssertUnaryOp(Round, values, ArrayFromJSON(float64(), pair.second));
+ this->AssertUnaryOp(Round, values,
+ ArrayFromJSON(this->type_singleton(), pair.second));
+ }
+
+ // Test different rounding mode
+ // skip uint8 because of its small range
+ if constexpr (!std::is_same_v<TypeParam, UInt8Type>) {
+ std::string values("[0, 1, 13, 50, 115, 176, 200, 250]");
Review Comment:
Done
--
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]