File tree Expand file tree Collapse file tree 1 file changed +1
-2
lines changed Expand file tree Collapse file tree 1 file changed +1
-2
lines changed Original file line number Diff line number Diff line change @@ -481,15 +481,14 @@ def _get_ordering(self):
481
481
else :
482
482
# The expression must be added to extra_fields with an alias.
483
483
field_name = f"__order{ next (idx )} "
484
- extra_fields [field_name ] = order .expression
484
+ fields [field_name ] = order .expression
485
485
# If the expression is ordered by NULLS FIRST or NULLS LAST,
486
486
# add a field for sorting that's 1 if null or 0 if not.
487
487
if order .nulls_first or order .nulls_last :
488
488
null_fieldname = f"__order{ next (idx )} "
489
489
condition = When (IsNull (order .expression , True ), then = Value (1 ))
490
490
extra_fields [null_fieldname ] = Case (condition , default = Value (0 ))
491
491
sort_ordering [null_fieldname ] = DESCENDING if order .nulls_first else ASCENDING
492
- fields [field_name ] = order .expression
493
492
sort_ordering [field_name ] = DESCENDING if order .descending else ASCENDING
494
493
return tuple (fields .items ()), sort_ordering , tuple (extra_fields .items ())
495
494
You can’t perform that action at this time.
0 commit comments