AlenkaF commented on code in PR #37405:
URL: https://github.com/apache/arrow/pull/37405#discussion_r2584026393


##########
python/pyarrow/public-api.pxi:
##########
@@ -441,3 +441,22 @@ cdef api object pyarrow_wrap_batch(
     cdef RecordBatch batch = RecordBatch.__new__(RecordBatch)
     batch.init(cbatch)
     return batch
+
+
+cdef api bint pyarrow_is_record_batch_reader(object record_batch_reader):
+    return isinstance(record_batch_reader, RecordBatchReader)
+
+
+cdef api shared_ptr[CRecordBatchReader] 
pyarrow_unwrap_record_batch_reader(object record_batch_reader):
+    cdef RecordBatchReader reader
+    if pyarrow_is_record_batch_reader(record_batch_reader):
+        reader = <RecordBatchReader>(record_batch_reader)
+        return reader.reader
+
+    return shared_ptr[CRecordBatchReader]()
+
+
+cdef api object pyarrow_wrap_record_batch_reader(const 
shared_ptr[CRecordBatchReader]& sp_record_batch_reader):

Review Comment:
   I think this is a great suggestion!
   Thanks for pointing it out @raulcd .



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