milesgranger commented on code in PR #14729:
URL: https://github.com/apache/arrow/pull/14729#discussion_r1033620156
##########
python/pyarrow/parquet/core.py:
##########
@@ -1165,8 +1165,10 @@ def get_metadata(self):
-------
metadata : FileMetaData
"""
- with self.open() as parquet:
- return parquet.metadata
+ parquet = self.open()
+ meta = parquet.metadata
+ parquet.close(True)
Review Comment:
It's slightly awkward since ParquetFile distinguishes between opening and
closing based on if it was the one who opened it. Indeed, `open()` opens the
source for `ParquetFile` and thus should probably mark it as being responsible
for closing. :+1:
https://github.com/apache/arrow/pull/14729/commits/e845fc85c99ed3e484a320b48234c0dcf861a19e
--
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]