niyue commented on code in PR #13041:
URL: https://github.com/apache/arrow/pull/13041#discussion_r980795792


##########
python/pyarrow/ipc.pxi:
##########
@@ -832,6 +862,26 @@ cdef class 
_RecordBatchFileWriter(_RecordBatchStreamWriter):
             self.writer = GetResultValue(
                 MakeFileWriter(c_sink, schema.sp_schema, self.options))
 
+_RecordBatchWithMetadata = namedtuple(
+    'RecordBatchWithMetadata',
+    ('batch', 'custom_metadata'))
+
+
+class RecordBatchWithMetadata(_RecordBatchWithMetadata):
+    """RecordBatch with its custom metadata
+
+    Parameters
+    ----------
+    batch: record batch
+    custom_metadata: record batch's custom metadata
+    """
+    __slots__ = ()
+
+
+@staticmethod
+cdef _wrap_record_batch_with_metadata(CRecordBatchWithMetadata c):
+    return RecordBatchWithMetadata(pyarrow_wrap_batch(c.batch), 
pyarrow_wrap_metadata(c.custom_metadata))

Review Comment:
   Fixed.



##########
python/pyarrow/ipc.pxi:
##########
@@ -832,6 +862,26 @@ cdef class 
_RecordBatchFileWriter(_RecordBatchStreamWriter):
             self.writer = GetResultValue(
                 MakeFileWriter(c_sink, schema.sp_schema, self.options))
 
+_RecordBatchWithMetadata = namedtuple(
+    'RecordBatchWithMetadata',
+    ('batch', 'custom_metadata'))
+
+
+class RecordBatchWithMetadata(_RecordBatchWithMetadata):
+    """RecordBatch with its custom metadata
+
+    Parameters
+    ----------
+    batch: record batch
+    custom_metadata: record batch's custom metadata

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]

Reply via email to