From f387d024fc75569d2a4a338bfda76cc2f328f627 Mon Sep 17 00:00:00 2001 From: Simon Charette Date: Wed, 10 Aug 2022 08:22:01 -0400 Subject: Refs #28333 -- Added partial support for filtering against window functions. Adds support for joint predicates against window annotations through subquery wrapping while maintaining errors for disjointed filter attempts. The "qualify" wording was used to refer to predicates against window annotations as it's the name of a specialized Snowflake extension to SQL that is to window functions what HAVING is to aggregates. While not complete the implementation should cover most of the common use cases for filtering against window functions without requiring the complex subquery pushdown and predicate re-aliasing machinery to deal with disjointed predicates against columns, aggregates, and window functions. A complete disjointed filtering implementation should likely be deferred until proper QUALIFY support lands or the ORM gains a proper subquery pushdown interface. --- django/db/models/fields/related_lookups.py | 1 + 1 file changed, 1 insertion(+) (limited to 'django/db/models/fields') diff --git a/django/db/models/fields/related_lookups.py b/django/db/models/fields/related_lookups.py index 17a8622ff9..1a845a1f7f 100644 --- a/django/db/models/fields/related_lookups.py +++ b/django/db/models/fields/related_lookups.py @@ -14,6 +14,7 @@ from django.utils.deprecation import RemovedInDjango50Warning class MultiColSource: contains_aggregate = False + contains_over_clause = False def __init__(self, alias, targets, sources, field): self.targets, self.sources, self.field, self.alias = ( -- cgit v1.3