Fixed #33543 -- Deprecated passing nulls_first/nulls_last=False to OrderBy and Expression.asc()/desc().

Thanks Allen Jonathan David for the initial patch.
This commit is contained in:
Mariusz Felisiak 2022-05-12 11:30:03 +02:00 committed by GitHub
parent 2798c937de
commit 68da6b389c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 70 additions and 10 deletions

View file

@ -1033,20 +1033,40 @@ calling the appropriate methods on the wrapped expression.
to a column. The ``alias`` parameter will be ``None`` unless the
expression has been annotated and is used for grouping.
.. method:: asc(nulls_first=False, nulls_last=False)
.. method:: asc(nulls_first=None, nulls_last=None)
Returns the expression ready to be sorted in ascending order.
``nulls_first`` and ``nulls_last`` define how null values are sorted.
See :ref:`using-f-to-sort-null-values` for example usage.
.. method:: desc(nulls_first=False, nulls_last=False)
.. versionchanged:: 4.1
In older versions, ``nulls_first`` and ``nulls_last`` defaulted to
``False``.
.. deprecated:: 4.1
Passing ``nulls_first=False`` or ``nulls_last=False`` to ``asc()``
is deprecated. Use ``None`` instead.
.. method:: desc(nulls_first=None, nulls_last=None)
Returns the expression ready to be sorted in descending order.
``nulls_first`` and ``nulls_last`` define how null values are sorted.
See :ref:`using-f-to-sort-null-values` for example usage.
.. versionchanged:: 4.1
In older versions, ``nulls_first`` and ``nulls_last`` defaulted to
``False``.
.. deprecated:: 4.1
Passing ``nulls_first=False`` or ``nulls_last=False`` to ``desc()``
is deprecated. Use ``None`` instead.
.. method:: reverse_ordering()
Returns ``self`` with any modifications required to reverse the sort