sameer727 opened a new pull request, #55726:
URL: https://github.com/apache/arrow/pull/55726

   Thanks for opening a pull request!
   If this is your first pull request you can find detailed information on how 
   to contribute here: 
https://arrow.apache.org/docs/dev/developers/guide/step_by_step/pr_lifecycle.html#reviews-and-merge-of-the-pull-request
   In order to make the review process go smoother, please check that:
   
   - [ ] Fixes the issue: #31678
   - [ ] Tests have been added
   - [ ] Documentation is updated
   
   If this is not a [minor 
PR](https://github.com/apache/arrow/blob/main/CONTRIBUTING.md#Minor-Fixes). 
Could you open an issue for this pull request on GitHub? 
https://github.com/apache/arrow/issues/new/choose
   
   Opening an issue provides the Apache Arrow community an opportunity to give 
feedback and evaluate whether this is a high-priority issue worth allocating 
time to review. Ideally, we would like an issue created prior to the opening of 
the PR. However, if the PR fixes an existing issue, then no new issue needs to 
be created.
   
   * GitHub Issue: #31678
   
   Resolves #31678
   
   ## Description of the changes
   
   Following the discussion in #31678, add a partitioned-dataset example to the 
"Writing `_metadata` and `_common_metadata` files" section of the Python 
parquet docs, showing how to write the metadata files for a dataset written 
with `partition_cols`.
   
   The partition columns are not stored in the data files (they are encoded in 
the directory names), so the schema passed to `pq.write_metadata` for the 
`_metadata` file needs to have the partition columns removed (as noted in the 
issue, `pq.write_metadata(table.schema, ...)` fails with "AppendRowGroups 
requires equal schemas" in this case). The `_common_metadata` file keeps the 
full dataset schema.
   
   The example was verified by running it locally with pyarrow 24.0.0 (write, 
then read back with `pq.ParquetDataset` / `pyarrow.dataset`), and the 
unpartitioned behavior is unchanged.
   
   Documentation-only change; no code behavior changes.


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