edponce commented on a change in pull request #10113:
URL: https://github.com/apache/arrow/pull/10113#discussion_r621567410
##########
File path: cpp/src/arrow/compute/kernels/scalar_arithmetic_test.cc
##########
@@ -817,5 +932,126 @@ TEST(TestBinaryArithmetic,
AddWithImplicitCastsUint64EdgeCase) {
ArrayFromJSON(uint64(),
"[18446744073709551615]")}));
}
+TEST(TestUnaryArithmetic, DispatchBest) {
+ for (std::string name : {"negate"}) {
+ for (const auto& ty : {int8(), int16(), int32(), int64(), uint8(),
uint16(), uint32(),
+ uint64(), float32(), float64()}) {
+ CheckDispatchBest(name, {ty}, {ty});
+ CheckDispatchBest(name, {dictionary(int8(), ty)}, {ty});
+ }
+ }
+
Review comment:
I did not add `CheckScalarUnary("negate",
std::make_shared<NullArray>(10), std::make_shared<NullArray>(10))` test because
it fails with `NotImplemented` kernel via a different path of functions.
Specifically, `CheckScalar()` --> `CallFunction()` which is where the error is
captured. I think adding a family of `CheckScalar*Fails()` function would be
beneficial for testing but consider it outside the scope of this PR. Should I
open an issue for extending these tests?
--
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.
For queries about this service, please contact Infrastructure at:
[email protected]