From 5a630ba52ccc26947129cbeee398b7a7c8aae7cc Mon Sep 17 00:00:00 2001 From: Khanh Bui <85855766+khanhmaibui@users.noreply.github.com> Date: Thu, 23 Mar 2023 16:45:56 -0700 Subject: [PATCH] allow partial support for filtering against window functions (#239) --- mssql/compiler.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/mssql/compiler.py b/mssql/compiler.py index 91ff9bc1..2dfe1b6c 100644 --- a/mssql/compiler.py +++ b/mssql/compiler.py @@ -230,6 +230,9 @@ def as_sql(self, with_limits=True, with_col_aliases=False): if not getattr(features, 'supports_select_{}'.format(combinator)): raise NotSupportedError('{} is not supported on this database backend.'.format(combinator)) result, params = self.get_combinator_sql(combinator, self.query.combinator_all) + elif django.VERSION >= (4, 2) and self.qualify: + result, params = self.get_qualify_sql() + order_by = None else: distinct_fields, distinct_params = self.get_distinct() # This must come after 'select', 'ordering', and 'distinct' -- see