File tree Expand file tree Collapse file tree 1 file changed +3
-6
lines changed
Expand file tree Collapse file tree 1 file changed +3
-6
lines changed Original file line number Diff line number Diff line change @@ -2153,7 +2153,8 @@ def sort(
21532153 -------------
21542154 <BLANKLINE>
21552155
2156- >>> df.sort(ascending=False).show()
2156+ >>> # Sort by all columns (ORDER BY ALL) - no columns specified
2157+ >>> df.sort([], ascending=False).show()
21572158 -------------
21582159 |"A" |"B" |
21592160 -------------
@@ -2182,13 +2183,9 @@ def sort(
21822183 The aliases ``order_by()`` and ``orderBy()`` have the same behavior.
21832184 """
21842185
2185- is_order_by_all = not cols
2186-
21872186 # This code performs additional type checks, run first.
21882187 exprs = self ._convert_cols_to_exprs ("sort()" , * cols )
2189- if not is_order_by_all :
2190- if not exprs :
2191- raise ValueError ("sort() needs at least one sort expression." )
2188+ is_order_by_all = not cols or not exprs
21922189
21932190 if (
21942191 is_order_by_all
You can’t perform that action at this time.
0 commit comments