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-9495: [C++] Equality assertions don't handle Inf / -Inf properly #7826
Conversation
c1943d5
to
d7766f3
Compare
cpp/src/arrow/array/array_test.cc
Outdated
// Infinity in a valid entry | ||
ArrayFromVector<TYPE>(type, {false, true}, {0.5, infinity}, &a); | ||
ArrayFromVector<TYPE>(type, {false, true}, {0.5, infinity}, &b); | ||
std::cout << a->ToString() << std::endl; |
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.
nit: we could remove this line.
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.
Removed. Thanks for your kind reminder.
Looks good to me |
left, right, [epsilon](T x, T y) -> bool { return fabs(x - y) <= epsilon; }); | ||
return BaseFloatingEquals<ArrowType>(left, right, [epsilon](T x, T y) -> bool { | ||
return (fabs(x - y) <= epsilon) || (x == y); | ||
}); |
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.
You must also change the nans_equal
path above.
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.
Revised accordingly. Thanks a lot for your kind reminder.
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.
+1. Thank you @liyafan82 !
See https://issues.apache.org/jira/browse/ARROW-9495 Closes apache#7826 from liyafan82/fly_0724_eq Authored-by: liyafan82 <fan_li_ya@foxmail.com> Signed-off-by: Antoine Pitrou <antoine@python.org>
See https://issues.apache.org/jira/browse/ARROW-9495 Closes apache#7826 from liyafan82/fly_0724_eq Authored-by: liyafan82 <fan_li_ya@foxmail.com> Signed-off-by: Antoine Pitrou <antoine@python.org>
See https://issues.apache.org/jira/browse/ARROW-9495 Closes apache#7826 from liyafan82/fly_0724_eq Authored-by: liyafan82 <fan_li_ya@foxmail.com> Signed-off-by: Antoine Pitrou <antoine@python.org>
See https://issues.apache.org/jira/browse/ARROW-9495