ARROW-13937: [C++][Compute] Add explicit output values to sign function and fix unary type checks#11113
Conversation
|
|
|
After revisiting the Also, shouldn't the floating-point kernels also return the same int type for |
1fb5c27 to
459e926
Compare
|
@lidavidm Please help with reviews when you get a chance. |
np.sign returns the same type as the input. |
lidavidm
left a comment
There was a problem hiding this comment.
Thanks. Having test coverage info would help us realize that overloads/branches aren't being taken, I think.
|
cc @lidavidm The floating-point kernels need to return a floating-point type because of I was thinking last week of tests for code coverage. I actually know of several snippets of dead code. |
…on and fix unary type checks This PR adds explicit output values to the sign function for the unsigned integer kernel. This makes the kernel more readable and consistent with the other sign kernels. Also, enable_if checks are fixed for scalar unary arithmetic functions (sign, negate, absolute, ceil/floor/trunc). Closes apache#11113 from edponce/ARROW-13937-Compute-Add-explicit-output-values-to-si Authored-by: Eduardo Ponce <[email protected]> Signed-off-by: David Li <[email protected]>
This PR adds explicit output values to the sign function for the unsigned integer kernel. This makes the kernel more readable and consistent with the other sign kernels.
Also, enable_if checks are fixed for scalar unary arithmetic functions (sign, negate, absolute, ceil/floor/trunc).