jorisvandenbossche commented on code in PR #13629:
URL: https://github.com/apache/arrow/pull/13629#discussion_r925244886
##########
python/pyarrow/parquet/__init__.py:
##########
@@ -3411,11 +3416,15 @@ def read_metadata(where, memory_map=False,
decryption_properties=None):
format_version: 2.6
serialized_size: 561
"""
+ filesystem, where = _resolve_filesystem_and_path(where, filesystem)
+ if filesystem is not None:
+ where = filesystem.open_input_file(where)
return ParquetFile(where, memory_map=memory_map,
Review Comment:
When opening the file with `open_input_file`, we should probably use it in a
context manager to ensure we also close the file handle again:
```
with filesystem.open_input_file(where) as source:
return ParquetFile(source, ...).metadata
```
(and the same for read_schema)
--
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]