jorisvandenbossche commented on code in PR #14574:
URL: https://github.com/apache/arrow/pull/14574#discussion_r1018163232


##########
python/pyarrow/parquet/core.py:
##########
@@ -3423,15 +3427,17 @@ def write_metadata(schema, where, 
metadata_collector=None, **kwargs):
     ...     table.schema, 'dataset_metadata/_metadata',
     ...     metadata_collector=metadata_collector)
     """
-    writer = ParquetWriter(where, schema, **kwargs)
+    writer = ParquetWriter(where, schema, filesystem, **kwargs)
     writer.close()
 
     if metadata_collector is not None:
         # ParquetWriter doesn't expose the metadata until it's written. Write
         # it and read it again.
-        metadata = read_metadata(where)
+        metadata = read_metadata(where, filesystem=filesystem)
         for m in metadata_collector:
             metadata.append_row_groups(m)
+        if filesystem is not None:
+            filesystem, where = _resolve_filesystem_and_path(where, filesystem)

Review Comment:
   That's would indeed be cleaner, I think (it can go to the first line of the 
function). 
   @milesgranger can you add a test using a URI? That should also cover this 
new ability (see my suggestion at 
https://github.com/apache/arrow/pull/14574#discussion_r1017707397, you can 
create a `meta3` and pass `meta3.as_uri()` as path)



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