rok commented on a change in pull request #12141:
URL: https://github.com/apache/arrow/pull/12141#discussion_r787666619



##########
File path: cpp/src/arrow/compute/kernels/scalar_temporal_test.cc
##########
@@ -976,6 +976,23 @@ TEST_F(ScalarTemporalTest, TestTemporalDifference) {
   }
 }
 
+TEST_F(ScalarTemporalTest, TestTemporalSubtractDuration) {
+  std::string op = "subtract";
+
+  for (auto u : TimeUnit::values()) {
+    auto unit = duration(u);
+    CheckScalarBinary(op,
+                      ArrayFromJSON(unit, times_s2),
+                      ArrayFromJSON(unit, times_s),
+                      ArrayFromJSON(unit, seconds_between_time));
+  }
+
+  EXPECT_RAISES_WITH_MESSAGE_THAT(
+      NotImplemented, testing::HasSubstr("no kernel matching input types"),
+      Subtract(ArrayFromJSON(duration(TimeUnit::SECOND), times_s),
+               ArrayFromJSON(duration(TimeUnit::MILLI), times_s)));
+}
+

Review comment:
       Ok, this now covers cases like `subtract(duration[ms], duration[us]) -> 
duration[us]`.




-- 
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]


Reply via email to