Re: [Django] #30683: QuerySet.count() crashes when window functions and conditional expressions are both used.

2019-08-05 Thread Django
#30683: QuerySet.count() crashes when window functions and conditional 
expressions
are both used.
-+-
 Reporter:  adamsol  |Owner:  nobody
 Type:  Bug  |   Status:  closed
Component:  Database layer   |  Version:  master
  (models, ORM)  |
 Severity:  Normal   |   Resolution:  duplicate
 Keywords:   | Triage Stage:
 |  Unreviewed
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Changes (by felixxm):

 * status:  new => closed
 * resolution:   => duplicate


Comment:

 `GROUP BY` issue was fixed in 3f32154f40a855afa063095e3d091ce6be21f2c5.

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/065.c7b2f3ede5363b35a2ac6feb42b3e3b2%40djangoproject.com.


Re: [Django] #30683: QuerySet.count() crashes when window functions and conditional expressions are both used. (was: QuerySet.count() crashes when window functions and conditional expressions are both

2019-08-05 Thread Django
#30683: QuerySet.count() crashes when window functions and conditional 
expressions
are both used.
-+-
 Reporter:  adamsol  |Owner:  nobody
 Type:  Bug  |   Status:  new
Component:  Database layer   |  Version:  master
  (models, ORM)  |
 Severity:  Normal   |   Resolution:
 Keywords:   | Triage Stage:
 |  Unreviewed
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Changes (by felixxm):

 * version:  2.2 => master


Comment:

 `QuerySet.filter()` part of this ticket was fixed in #30668.

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/065.2776d7b101d156928a2da05f9dd16e75%40djangoproject.com.


[Django] #30683: QuerySet.count() crashes when window functions and conditional expressions are both used

2019-08-05 Thread Django
#30683: QuerySet.count() crashes when window functions and conditional 
expressions
are both used
-+-
   Reporter:  adamsol|  Owner:  nobody
   Type:  Bug| Status:  new
  Component:  Database   |Version:  2.2
  layer (models, ORM)|
   Severity:  Normal |   Keywords:
   Triage Stage: |  Has patch:  0
  Unreviewed |
Needs documentation:  0  |Needs tests:  0
Patch needs improvement:  0  |  Easy pickings:  0
  UI/UX:  0  |
-+-
 Any `count()` query with window functions inside conditional expressions,
 like:

 {{{Model.objects.annotate(rank=Case(When(condition=~Q(pk=None),
 then=Window(Rank(), order_by=F('pk').count()}}}

 throws an error:

 {{{django.db.utils.ProgrammingError: window functions are not allowed in
 GROUP BY}}}

 The query works after adding `.values('pk')` to it or when conditional
 expressions are not used.

 There is a similar inconsistency when we call e.g. `.filter(rank__gt=0)`
 instead of `.count()`. It doesn't work anyway (#28333), but there are two
 different errors depending on whether conditionals are used:
 `django.db.utils.ProgrammingError: window functions are not allowed in
 WHERE` or `django.db.utils.NotSupportedError: Window is disallowed in the
 filter clause.`.

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/050.908f017a591fe24382702bec8a7a1deb%40djangoproject.com.