]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
clarify clauses argument for order_by, group_by
authorMike Bayer <mike_mp@zzzcomputing.com>
Fri, 19 Sep 2025 14:32:43 +0000 (10:32 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Fri, 19 Sep 2025 14:35:15 +0000 (10:35 -0400)
Change-Id: Idabfde4a6850a2649a2f32dc42d0320f1ec7692d
(cherry picked from commit 38008698207dc3703f2565aa8b41f95596724272)

lib/sqlalchemy/sql/selectable.py

index 9e7c647d93719a1d60abc26f7b0e700d4e549dd9..fc60436bbb861237b48e5e7b8ef3ba5ccba715cf 100644 (file)
@@ -4392,8 +4392,13 @@ class GenerativeSelect(DialectKWArgs, SelectBase, Generative):
             stmt = stmt.order_by(None).order_by(new_col)
 
         :param \*clauses: a series of :class:`_expression.ColumnElement`
-         constructs
-         which will be used to generate an ORDER BY clause.
+         constructs which will be used to generate an ORDER BY clause.
+
+         Alternatively, an individual entry may also be the string name of a
+         label located elsewhere in the columns clause of the statement which
+         will be matched and rendered in a backend-specific way based on
+         context; see :ref:`tutorial_order_by_label` for background on string
+         label matching in ORDER BY and GROUP BY expressions.
 
         .. seealso::
 
@@ -4433,8 +4438,13 @@ class GenerativeSelect(DialectKWArgs, SelectBase, Generative):
             stmt = select(table.c.name, func.max(table.c.stat)).group_by(table.c.name)
 
         :param \*clauses: a series of :class:`_expression.ColumnElement`
-         constructs
-         which will be used to generate an GROUP BY clause.
+         constructs which will be used to generate an GROUP BY clause.
+
+         Alternatively, an individual entry may also be the string name of a
+         label located elsewhere in the columns clause of the statement which
+         will be matched and rendered in a backend-specific way based on
+         context; see :ref:`tutorial_order_by_label` for background on string
+         label matching in ORDER BY and GROUP BY expressions.
 
         .. seealso::