felipecrv commented on code in PR #36800:
URL: https://github.com/apache/arrow/pull/36800#discussion_r1272922880
##########
cpp/src/arrow/compute/kernels/scalar_temporal_test.cc:
##########
@@ -1718,6 +1719,13 @@ TEST_F(ScalarTemporalTest, TestTemporalDivideDuration) {
CallFunction("divide_checked",
{durations, zeros}));
}
}
+
+ // div(duration, duration) -> float64
+ auto left = ArrayFromJSON(duration(TimeUnit::SECOND), "[1, 2, 3, 4]");
+ auto right = ArrayFromJSON(duration(TimeUnit::MILLI), "[4000, 300, 20, 1]");
+ auto expected = ArrayFromJSON(float64(), "[0.25, 6.666666666666667, 150,
4000]");
+ CheckScalarBinary("divide", left, right, expected);
+ CheckScalarBinary("divide_checked", left, right, expected);
Review Comment:
Should probably add division of MILLIs by SECOND to ensure we get unit
handling correctly on the other direction as well.
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]