You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2021/10/20 10:29:14 UTC
[GitHub] [arrow] amol- commented on a change in pull request #11455: ARROW-13668: [Python] Add `write_batch` and `write` methods to `ParquetWriter`
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: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org