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


##########
python/pyarrow/table.pxi:
##########
@@ -3549,6 +3549,29 @@ cdef class RecordBatch(_Tabular):
                                                                              
row_major, pool))
         return pyarrow_wrap_tensor(c_tensor)
 
+    def copy_to(self, MemoryManager memory_manager):
+        """
+        Copy the entire RecordBatch to destination MemoryManager.
+
+        This copies each column of the record batch to create
+        a new record batch where all underlying buffers for the columns have
+        been copied to the destination MemoryManager.
+
+        Parameters
+        ----------
+        memory_manager : pyarrow.MemoryManager
+
+        Returns
+        ------
+        RecordBatch
+        """
+        cdef:
+            shared_ptr[CRecordBatch] c_batch
+
+        with nogil:
+            c_batch = 
GetResultValue(self.batch.CopyTo(memory_manager.unwrap()))

Review Comment:
   I don't think copying to the same memory manager is really useful, so we 
needn't allow None IMHO.



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