From 759f676ae00ed3623621cf0287be0ff3498afe16 Mon Sep 17 00:00:00 2001 From: Mike Bayer Date: Sun, 19 Aug 2018 22:19:59 -0400 Subject: Add missing range_ / rows parameters to additional over() methods Added missing window function parameters :paramref:`.WithinGroup.over.range_` and :paramref:`.WithinGroup.over.rows` parameters to the :meth:`.WithinGroup.over` and :meth:`.FunctionFilter.over` methods, to correspond to the range/rows feature added to the "over" method of SQL functions as part of :ticket:`3049` in version 1.1. Fixes: #4322 Change-Id: I77dcdac65c699a4b52a3fc3ee09a100ffb4fc20e (cherry picked from commit 3e2f61c439dab76133a49b7a16b03bf4071d4c4c) --- lib/sqlalchemy/sql/elements.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'lib/sqlalchemy/sql') diff --git a/lib/sqlalchemy/sql/elements.py b/lib/sqlalchemy/sql/elements.py index 2a6fa323c..5f9fd2ebf 100644 --- a/lib/sqlalchemy/sql/elements.py +++ b/lib/sqlalchemy/sql/elements.py @@ -3368,7 +3368,7 @@ class WithinGroup(ColumnElement): *util.to_list(order_by), _literal_as_text=_literal_as_label_reference) - def over(self, partition_by=None, order_by=None): + def over(self, partition_by=None, order_by=None, range_=None, rows=None): """Produce an OVER clause against this :class:`.WithinGroup` construct. @@ -3376,7 +3376,9 @@ class WithinGroup(ColumnElement): :meth:`.FunctionElement.over`. """ - return Over(self, partition_by=partition_by, order_by=order_by) + return Over( + self, partition_by=partition_by, order_by=order_by, + range_=range_, rows=rows) @util.memoized_property def type(self): @@ -3477,7 +3479,7 @@ class FunctionFilter(ColumnElement): return self - def over(self, partition_by=None, order_by=None): + def over(self, partition_by=None, order_by=None, range_=None, rows=None): """Produce an OVER clause against this filtered function. Used against aggregate or so-called "window" functions, @@ -3495,7 +3497,9 @@ class FunctionFilter(ColumnElement): See :func:`~.expression.over` for a full description. """ - return Over(self, partition_by=partition_by, order_by=order_by) + return Over( + self, partition_by=partition_by, order_by=order_by, + range_=range_, rows=rows) @util.memoized_property def type(self): -- cgit v1.2.1