milesgranger opened a new pull request, #13821: URL: https://github.com/apache/arrow/pull/13821
Will fix [ARROW-13763](https://issues.apache.org/jira/browse/ARROW-13763) A separate Jira issue will be made to address closing files in V2 ParquetDataset, which needs to be handled in the C++ layer. Adds context manager to `pq.ParquetFile` to close input file, and ensure reads within `pq.ParquetDataset` are closed. ```python buf: io.BytesIO with pq.ParquetFile(buf) as parquet: table = parquet.read() assert buf.closed # or... p = pq.ParquetFile(buf) table = p.read() assert not buf.closed p.close() assert buf.closed ``` -- 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]
