]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
fix comment
authorReuven Starodubski <reuven.s@claroty.com>
Thu, 11 Sep 2025 17:29:08 +0000 (20:29 +0300)
committerReuven Starodubski <reuven.s@claroty.com>
Thu, 11 Sep 2025 17:29:08 +0000 (20:29 +0300)
lib/sqlalchemy/dialects/postgresql/ext.py

index 955b1761ee7a9e779d5074c5f9ce639008694024..1bd20fea294390d3cc10b968e215aa7c723951e5 100644 (file)
@@ -17,6 +17,7 @@ from typing import TypeVar
 
 from . import types
 from .array import ARRAY
+from ...sql import aggregate_order_by as aggregate_order_by_core
 from ...sql import coercions
 from ...sql import elements
 from ...sql import expression
@@ -39,51 +40,8 @@ if TYPE_CHECKING:
 _T = TypeVar("_T", bound=Any)
 
 
-class aggregate_order_by(elements.AggregateOrderBy[_T]):
-    """Represent an aggregate order by expression.
-
-    .. deprecated:: 2.0.X
-        The PostgreSQL-specific :class:`aggregate_order_by` is deprecated.
-        Please use :func:`sqlalchemy.sql.expression.aggregate_order_by` instead,
-        which is now available as core functionality.
-
-    E.g.::
-
-        from sqlalchemy.dialects.postgresql import aggregate_order_by
-
-        expr = func.array_agg(aggregate_order_by(table.c.a, table.c.b.desc()))
-        stmt = select(expr)
-
-    would represent the expression:
-
-    .. sourcecode:: sql
-
-        SELECT array_agg(a ORDER BY b DESC) FROM table;
-
-    Similarly::
-
-        expr = func.string_agg(
-            table.c.a, aggregate_order_by(literal_column("','"), table.c.a)
-        )
-        stmt = select(expr)
-
-    Would represent:
-
-    .. sourcecode:: sql
-
-        SELECT string_agg(a, ',' ORDER BY a) FROM table;
-
-    .. versionchanged:: 1.2.13 - the ORDER BY argument may be multiple terms
-
-    .. versionchanged:: 2.0.X - moved to core functionality as :func:`sqlalchemy.sql.expression.aggregate_order_by`
-
-    .. seealso::
-
-        :func:`sqlalchemy.sql.expression.aggregate_order_by`
-
-        :class:`_functions.array_agg`
-
-    """
+def aggregate_order_by(target: expression.ColumnElement[_T], *order_by:  expression.ColumnElement[_T]):
+    return aggregate_order_by_core(target, *order_by)
 
 class ExcludeConstraint(ColumnCollectionConstraint):
     """A table-level EXCLUDE constraint.