rok commented on a change in pull request #9758:
URL: https://github.com/apache/arrow/pull/9758#discussion_r616261860
##########
File path: cpp/src/arrow/compute/kernels/aggregate_test.cc
##########
@@ -374,22 +476,31 @@ static Datum NaiveMean(const Array& array) {
}
template <typename ArrowType>
-void ValidateMean(const Array& input, Datum expected) {
+void ValidateMean(const Array& input, Datum expected,
+ const ScalarAggregateOptions& options) {
using OutputType = typename FindAccumulatorType<DoubleType>::Type;
- ASSERT_OK_AND_ASSIGN(Datum result, Mean(input));
- DatumEqual<OutputType>::EnsureEqual(result, expected);
+ ASSERT_OK_AND_ASSIGN(Datum result, Mean(input, options, nullptr));
+ using ScalarType = typename TypeTraits<OutputType>::ScalarType;
+ const auto& res = checked_pointer_cast<ScalarType>(result.scalar());
+ const auto& exp = checked_pointer_cast<ScalarType>(expected.scalar());
+ if (!(std::isnan(res->value) && std::isnan(exp->value))) {
+ DatumEqual<OutputType>::EnsureEqual(result, expected);
+ }
Review comment:
Same here.
--
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]