djkapner opened a new issue, #41699:
URL: https://github.com/apache/arrow/issues/41699

   ### Describe the bug, including details regarding any error messages, 
version, and platform.
   
   When a `SortingColumn` is present, the metadata of a `ParquetFile` can not 
be serialized with `to_dict()` because `SortingColumn` is missing this method.
   
   ```
   import polars as pl
   import pyarrow.parquet as pq
   
   df = pl.DataFrame({"a": [1, 2], "b": [10, 11]})
   fname = "tmp.parquet"
   pq.write_table(
       df.to_arrow(),
       fname,
       sorting_columns=[pq.SortingColumn(0),],
   )
   
   pqf = pq.ParquetFile(fname)
   print(pqf.metadata.row_group(0).sorting_columns[0])
   print(pqf.metadata.to_dict())
   ```
   results in :
   ```
   SortingColumn(column_index=0, descending=False, nulls_first=False)
   ...
   
     File "pyarrow/_parquet.pyx", line 892, in 
pyarrow._parquet.FileMetaData.to_dict
     File "pyarrow/_parquet.pyx", line 790, in 
pyarrow._parquet.RowGroupMetaData.to_dict
   AttributeError: 'pyarrow._parquet.SortingColumn' object has no attribute 
'to_dict'
   ```
   
   ### Component(s)
   
   Parquet, Python


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