lidavidm commented on a change in pull request #12621:
URL: https://github.com/apache/arrow/pull/12621#discussion_r826895042



##########
File path: python/pyarrow/table.pxi
##########
@@ -2010,6 +2010,37 @@ cdef class Table(_PandasConvertible):
 
         return result
 
+    def to_reader(self, max_chunksize=None, **kwargs):
+        """
+        Convert a Table to RecordBatchReader
+
+        Returns
+        -------
+        RecordBatchReader        
+        """
+        cdef:
+            shared_ptr[CRecordBatchReader] c_reader
+            RecordBatchReader reader
+            shared_ptr[TableBatchReader] t_reader
+        t_reader = make_shared[TableBatchReader](self.sp_table)
+
+        if 'chunksize' in kwargs:
+            max_chunksize = kwargs['chunksize']
+            msg = ('The parameter chunksize is deprecated for '
+                   'pyarrow.Table.to_batches as of 0.15, please use '
+                   'the parameter max_chunksize instead')
+            warnings.warn(msg, FutureWarning)

Review comment:
       IMO, we can drop `kwargs` and the backwards compatibility here, this is 
a new API

##########
File path: python/pyarrow/table.pxi
##########
@@ -2010,6 +2010,37 @@ cdef class Table(_PandasConvertible):
 
         return result
 
+    def to_reader(self, max_chunksize=None, **kwargs):
+        """
+        Convert a Table to RecordBatchReader
+
+        Returns
+        -------
+        RecordBatchReader        
+        """
+        cdef:
+            shared_ptr[CRecordBatchReader] c_reader
+            RecordBatchReader reader
+            shared_ptr[TableBatchReader] t_reader
+        t_reader = make_shared[TableBatchReader](self.sp_table)
+
+        if 'chunksize' in kwargs:
+            max_chunksize = kwargs['chunksize']
+            msg = ('The parameter chunksize is deprecated for '
+                   'pyarrow.Table.to_batches as of 0.15, please use '
+                   'the parameter max_chunksize instead')
+            warnings.warn(msg, FutureWarning)
+
+        if max_chunksize is not None:
+            c_max_chunksize = max_chunksize

Review comment:
       nit: I don't think this extra assignment does anything (though maybe 
Cython requires it for some reason)




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