-
Notifications
You must be signed in to change notification settings - Fork 4k
ARROW-13937: [C++][Compute] Add explicit output values to sign function and fix unary type checks #11113
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 <edponce00@gmail.com> Signed-off-by: David Li <li.davidm96@gmail.com>
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).