amol- commented on a change in pull request #11455:
URL: https://github.com/apache/arrow/pull/11455#discussion_r732633718



##########
File path: python/pyarrow/parquet.py
##########
@@ -687,7 +687,43 @@ def __exit__(self, *args, **kwargs):
         # return false since we want to propagate exceptions
         return False
 
+    def write(self, table_or_batch):
+        """
+        Write RecordBatch or Table to stream.
+
+        Parameters
+        ----------
+        table_or_batch : {RecordBatch, Table}
+        """
+        if isinstance(table_or_batch, pa.RecordBatch):
+            self.write_batch(table_or_batch)
+        elif isinstance(table_or_batch, pa.Table):
+            self.write_table(table_or_batch)
+        else:
+            raise ValueError(type(table_or_batch))

Review comment:
       This should be a `TypeError`




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