niyue commented on code in PR #13041:
URL: https://github.com/apache/arrow/pull/13041#discussion_r990940556
##########
python/pyarrow/ipc.pxi:
##########
@@ -687,6 +692,49 @@ cdef class RecordBatchReader(_Weakrefable):
return pyarrow_wrap_batch(batch)
+ def read_next_batch_with_custom_metadata(self):
+ """
+ Read next RecordBatch from the stream along with its custom metadata.
+
+ Raises
+ ------
+ StopIteration:
+ At end of stream.
+
+ Returns
+ -------
+ batch : RecordBatch
+ custom_metadata : KeyValueMetadata
+ """
+ cdef:
+ CRecordBatchWithMetadata batch_with_metadata
+
+ with nogil:
+ batch_with_metadata = GetResultValue(self.reader.get().ReadNext())
+
+ if batch_with_metadata.batch.get() == NULL:
+ raise StopIteration
+
+ return _wrap_record_batch_with_metadata(batch_with_metadata)
+
+ def iter_batches_with_custom_metadata(self):
+ """
+ Read next RecordBatch from the stream along with its custom metadata
as a generator
+ Raises
Review Comment:
Fixed.
--
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]