pitrou commented on code in PR #43192:
URL: https://github.com/apache/arrow/pull/43192#discussion_r1670726701


##########
python/pyarrow/tests/test_ipc.py:
##########
@@ -1199,6 +1199,25 @@ def make_batches():
         reader = pa.RecordBatchReader.from_batches(None, batches)
         pass
 
+    # https://github.com/apache/arrow/issues/43183

Review Comment:
   If we really want to test this on the Python side, it would be more logical 
to add a test to `test_compute.py` as this is not IPC-related at all.



##########
cpp/src/arrow/compute/kernels/scalar_cast_temporal.cc:
##########
@@ -510,9 +510,12 @@ void AddCrossUnitCastNoPreallocate(CastFunction* func) {
 
 std::shared_ptr<CastFunction> GetDate32Cast() {
   auto func = std::make_shared<CastFunction>("cast_date32", Type::DATE32);
-  auto out_ty = date32();
+  const auto& out_ty = date32();
   AddCommonCasts(Type::DATE32, out_ty, func.get());
 
+  // date32 -> date32
+  AddCrossUnitCast<Date32Type>(func.get());

Review Comment:
   Can't we just call `AddZeroCopyCast` here? Only a single unit is supported 
for date32.



##########
cpp/src/arrow/compute/kernels/scalar_cast_temporal.cc:
##########
@@ -532,9 +535,12 @@ std::shared_ptr<CastFunction> GetDate32Cast() {
 
 std::shared_ptr<CastFunction> GetDate64Cast() {
   auto func = std::make_shared<CastFunction>("cast_date64", Type::DATE64);
-  auto out_ty = date64();
+  const auto& out_ty = date64();
   AddCommonCasts(Type::DATE64, out_ty, func.get());
 
+  // date64 -> date64
+  AddCrossUnitCast<Date64Type>(func.get());

Review Comment:
   Same question 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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to