Re: [Django] #34975: Getting refs does not work properly with models.Window and aggregation

2023-11-17 Thread Django
#34975: Getting refs does not work properly with models.Window and aggregation
-+-
 Reporter:  Sergey Nesterenko|Owner:  Simon
 |  Charette
 Type:  Bug  |   Status:  assigned
Component:  Database layer   |  Version:  4.2
  (models, ORM)  |
 Severity:  Release blocker  |   Resolution:
 Keywords:  QuerySet, Window,| Triage Stage:  Accepted
  Aggregate, F   |
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Changes (by Simon Charette):

 * has_patch:  0 => 1


-- 
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/0107018be0371665-c6309a4b-df39-4c7c-aba3-5dacacd5deea-00%40eu-central-1.amazonses.com.


Re: [Django] #34975: Getting refs does not work properly with models.Window and aggregation

2023-11-17 Thread Django
#34975: Getting refs does not work properly with models.Window and aggregation
-+-
 Reporter:  Sergey Nesterenko|Owner:  Simon
 |  Charette
 Type:  Bug  |   Status:  assigned
Component:  Database layer   |  Version:  4.2
  (models, ORM)  |
 Severity:  Release blocker  |   Resolution:
 Keywords:  QuerySet, Window,| Triage Stage:  Accepted
  Aggregate, F   |
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Changes (by Simon Charette):

 * severity:  Normal => Release blocker


Comment:

 Confirmed regression in b181cae2e3697b2e53b5b67ac67e59f3b05a6f0d, refs
 #25307.

-- 
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/0107018be00c4f18-1b67d316-257e-43eb-aef0-c7aaac2b169e-00%40eu-central-1.amazonses.com.


Re: [Django] #34975: Getting refs does not work properly with models.Window and aggregation

2023-11-17 Thread Django
#34975: Getting refs does not work properly with models.Window and aggregation
-+-
 Reporter:  Sergey Nesterenko|Owner:  Simon
 |  Charette
 Type:  Bug  |   Status:  assigned
Component:  Database layer   |  Version:  4.2
  (models, ORM)  |
 Severity:  Normal   |   Resolution:
 Keywords:  QuerySet, Window,| Triage Stage:  Accepted
  Aggregate, F   |
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-

Comment (by Simon Charette):

 I've got an idea of how to solve this, it's not clear to me if it's a
 regression as the underlying cause has little to do with window functions.

 In the mean time, can you confirm that switching the order of your lookup
 resolve the issue. That is doing `filter=Q(new_ordering=F('ordering'))`
 instead of `filter=Q(ordering=F('new_ordering'))`.

-- 
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/0107018bdf9c2a66-0105dc94-41e3-49ab-9c76-3c38dba06811-00%40eu-central-1.amazonses.com.


Re: [Django] #34975: Getting refs does not work properly with models.Window and aggregation

2023-11-17 Thread Django
#34975: Getting refs does not work properly with models.Window and aggregation
-+-
 Reporter:  Sergey Nesterenko|Owner:  Simon
 |  Charette
 Type:  Bug  |   Status:  assigned
Component:  Database layer   |  Version:  4.2
  (models, ORM)  |
 Severity:  Normal   |   Resolution:
 Keywords:  QuerySet, Window,| Triage Stage:  Accepted
  Aggregate, F   |
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Changes (by Simon Charette):

 * owner:  nobody => Simon Charette
 * status:  new => assigned


-- 
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/0107018bdf99c4e1-4f580a20-9949-476d-acd5-9b3d3780-00%40eu-central-1.amazonses.com.


Re: [Django] #34975: Getting refs does not work properly with models.Window and aggregation

2023-11-17 Thread Django
#34975: Getting refs does not work properly with models.Window and aggregation
-+-
 Reporter:  Sergey Nesterenko|Owner:  nobody
 Type:  Bug  |   Status:  new
Component:  Database layer   |  Version:  4.2
  (models, ORM)  |
 Severity:  Normal   |   Resolution:
 Keywords:  QuerySet, Window,| Triage Stage:  Accepted
  Aggregate, F   |
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-

Comment (by Sergey Nesterenko):

 Replying to [comment:4 Simon Charette]:
 > I'm not sure if something else will break as I don't think we have
 extensive testing for performing filtered aggregation over a window
 function but does the following patch helps
 >
 > {{{#!python
 > diff --git a/django/db/models/expressions.py
 b/django/db/models/expressions.py
 > index 3a0c75ebf2..74ae9cab8e 100644
 > --- a/django/db/models/expressions.py
 > +++ b/django/db/models/expressions.py
 > @@ -417,6 +417,8 @@ def replace_expressions(self, replacements):
 >  def get_refs(self):
 >  refs = set()
 >  for expr in self.get_source_expressions():
 > +if expr is None:
 > +continue
 >  refs |= expr.get_refs()
 >  return refs
 > }}}


 I thought about it, but I wasn't sure it wouldn't break anything, but it
 might work.

-- 
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/0107018bde8126dd-fdadeef2-d87d-4fd6-88d4-9708f86d8399-00%40eu-central-1.amazonses.com.


Re: [Django] #34975: Getting refs does not work properly with models.Window and aggregation

2023-11-17 Thread Django
#34975: Getting refs does not work properly with models.Window and aggregation
-+-
 Reporter:  Sergey Nesterenko|Owner:  nobody
 Type:  Bug  |   Status:  new
Component:  Database layer   |  Version:  4.2
  (models, ORM)  |
 Severity:  Normal   |   Resolution:
 Keywords:  QuerySet, Window,| Triage Stage:  Accepted
  Aggregate, F   |
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-

Comment (by Simon Charette):

 I'm not sure if something else will break as I don't think we have
 extensive testing for performing filtered aggregation over a window
 function but does the following patch helps

 {{{#!python
 diff --git a/django/db/models/expressions.py
 b/django/db/models/expressions.py
 index 3a0c75ebf2..74ae9cab8e 100644
 --- a/django/db/models/expressions.py
 +++ b/django/db/models/expressions.py
 @@ -417,6 +417,8 @@ def replace_expressions(self, replacements):
  def get_refs(self):
  refs = set()
  for expr in self.get_source_expressions():
 +if expr is None:
 +continue
  refs |= expr.get_refs()
  return refs
 }}}

-- 
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/0107018bde7cf397-96dc58b4-79f8-4866-8187-88aa874816d4-00%40eu-central-1.amazonses.com.


Re: [Django] #34975: Getting refs does not work properly with models.Window and aggregation

2023-11-17 Thread Django
#34975: Getting refs does not work properly with models.Window and aggregation
-+-
 Reporter:  Sergey Nesterenko|Owner:  nobody
 Type:  Bug  |   Status:  new
Component:  Database layer   |  Version:  4.2
  (models, ORM)  |
 Severity:  Normal   |   Resolution:
 Keywords:  QuerySet, Window,| Triage Stage:  Accepted
  Aggregate, F   |
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Changes (by Simon Charette):

 * stage:  Unreviewed => Accepted


Comment:

 Another instance of a crash due to mishandling of
 `get_source_expressions()` being `Expression | None`.

-- 
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/0107018bde7a1a79-bfb482f5-daa2-4b88-9963-6e1ed0456a24-00%40eu-central-1.amazonses.com.


Re: [Django] #34975: Getting refs does not work properly with models.Window and aggregation (was: Getting refs is not work properly with models.Window and aggregation)

2023-11-17 Thread Django
#34975: Getting refs does not work properly with models.Window and aggregation
-+-
 Reporter:  Sergey Nesterenko|Owner:  nobody
 Type:  Bug  |   Status:  new
Component:  Database layer   |  Version:  4.2
  (models, ORM)  |
 Severity:  Normal   |   Resolution:
 Keywords:  QuerySet, Window,| Triage Stage:
  Aggregate, F   |  Unreviewed
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-

-- 
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/0107018bde61bc45-d9c4c0bc-b600-4189-b21b-50229dedd801-00%40eu-central-1.amazonses.com.