judahrand commented on code in PR #37665:
URL: https://github.com/apache/arrow/pull/37665#discussion_r1376082697


##########
python/pyarrow/_parquet.pxd:
##########
@@ -24,7 +24,7 @@ from pyarrow.includes.libarrow cimport (CChunkedArray, 
CScalar, CSchema, CStatus
                                         CKeyValueMetadata,
                                         CRandomAccessFile, COutputStream,
                                         TimeUnit, CRecordBatchReader)
-from pyarrow.lib cimport _Weakrefable
+from pyarrow.lib cimport (_Weakrefable, pyarrow_unwrap_schema)

Review Comment:
   
https://github.com/apache/arrow/pull/37665/commits/4ea6a7797155cbe41a4e7cc29d822886c8b3361f



##########
python/pyarrow/_parquet.pyx:
##########
@@ -1546,6 +1761,31 @@ cdef class ParquetReader(_Weakrefable):
         return closed
 
 
+cdef CSortingColumn _convert_sorting_column(SortingColumn sorting_column):
+    cdef CSortingColumn c_sorting_column
+
+    c_sorting_column.column_idx = sorting_column.column_index
+    c_sorting_column.descending = sorting_column.descending
+    c_sorting_column.nulls_first = sorting_column.nulls_first
+
+    return c_sorting_column
+
+
+cdef vector[CSortingColumn] _convert_sorting_columns(sorting_columns) except *:
+    if not (isinstance(sorting_columns, Sequence)
+            and all(isinstance(col, SortingColumn) for col in 
sorting_columns)):
+        raise ValueError(
+            "'sorting_columns' must be a list of `SortingColumn`")
+
+    cdef vector[CSortingColumn] c_sorting_columns = 
[_convert_sorting_column(col)
+                                                     for col in 
sorting_columns]
+
+    if len(sorting_columns) != len(c_sorting_columns):
+        raise ValueError("something has gone wrong")

Review Comment:
   
https://github.com/apache/arrow/pull/37665/commits/fcfd65bfc05101b0406d30bc4f7602758d0bc4b9



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