MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / over

Method over

lib/sqlalchemy/sql/elements.py:4958–4993  ·  view source on GitHub ↗

Produce an OVER clause against this filtered function. Used against aggregate or so-called "window" functions, for database backends that support window functions. The expression:: func.rank().filter(MyClass.y > 5).over(order_by="x") is shorthand for::

(
        self,
        partition_by: _ByArgument | None = None,
        order_by: _ByArgument | None = None,
        range_: _FrameIntTuple | FrameClause | None = None,
        rows: _FrameIntTuple | FrameClause | None = None,
        groups: _FrameIntTuple | FrameClause | None = None,
        exclude: str | None = None,
    )

Source from the content-addressed store, hash-verified

4956 return self
4957
4958 def over(
4959 self,
4960 partition_by: _ByArgument | None = None,
4961 order_by: _ByArgument | None = None,
4962 range_: _FrameIntTuple | FrameClause | None = None,
4963 rows: _FrameIntTuple | FrameClause | None = None,
4964 groups: _FrameIntTuple | FrameClause | None = None,
4965 exclude: str | None = None,
4966 ) -> Over[_T]:
4967 """Produce an OVER clause against this filtered function.
4968
4969 Used against aggregate or so-called "window" functions,
4970 for database backends that support window functions.
4971
4972 The expression::
4973
4974 func.rank().filter(MyClass.y > 5).over(order_by="x")
4975
4976 is shorthand for::
4977
4978 from sqlalchemy import over, funcfilter
4979
4980 over(funcfilter(func.rank(), MyClass.y > 5), order_by="x")
4981
4982 See :func:`_expression.over` for a full description.
4983
4984 """
4985 return Over(
4986 self,
4987 partition_by=partition_by,
4988 order_by=order_by,
4989 range_=range_,
4990 rows=rows,
4991 groups=groups,
4992 exclude=exclude,
4993 )
4994
4995 def within_group(
4996 self, *order_by: _ColumnExpressionArgument[Any]

Calls 1

OverClass · 0.85