Skip to content

Commit 031f05c

Browse files
committed
refactor: update _convert_file_sort_order to use SortKey for improved type safety
1 parent 8f15e11 commit 031f05c

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

python/datafusion/context.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1176,8 +1176,16 @@ def execute(self, plan: ExecutionPlan, partitions: int) -> RecordBatchStream:
11761176

11771177
@staticmethod
11781178
def _convert_file_sort_order(
1179-
file_sort_order: list[list[Expr | SortExpr | str]] | None,
1179+
file_sort_order: list[list[SortKey]] | None,
11801180
) -> list[list[Any]] | None:
1181+
"""Convert nested ``SortKey`` lists into raw sort representations.
1182+
1183+
Each ``SortKey`` can be a column name string, an ``Expr``, or a
1184+
``SortExpr`` and will be converted using
1185+
:func:`datafusion.expr.sort_list_to_raw_sort_list`.
1186+
"""
1187+
# Convert each ``SortKey`` in the provided sort order to the low-level
1188+
# representation expected by the Rust bindings.
11811189
return (
11821190
[sort_list_to_raw_sort_list(f) for f in file_sort_order]
11831191
if file_sort_order is not None

0 commit comments

Comments
 (0)