Re: [Django] #35665: Prefetch() fails with "OrderByList" when queryset has no order_by and is sliced

2024-08-13 Thread Django
#35665: Prefetch() fails with "OrderByList" when queryset has no order_by and is
sliced
-+-
 Reporter:  Andrew   |Owner:  Simon
 |  Charette
 Type:  Bug  |   Status:  closed
Component:  Database layer   |  Version:  5.1
  (models, ORM)  |
 Severity:  Release blocker  |   Resolution:  fixed
 Keywords:  prefetch slice   | Triage Stage:  Ready for
  order_by   |  checkin
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Comment (by Sarah Boyce <42296566+sarahboyce@…>):

 In [changeset:"df236b0bcbbf1f54dfe6acc7761cd81b76ebf2cc" df236b0]:
 {{{#!CommitTicketReference repository=""
 revision="df236b0bcbbf1f54dfe6acc7761cd81b76ebf2cc"
 [5.1.x] Fixed #35665 -- Fixed a crash when passing an empty order_by to
 Window.

 This also caused un-ordered sliced prefetches to crash as they rely on
 Window.

 Regression in e16d0c176e9b89628cdec5e58c418378c4a2436a that made
 OrderByList
 piggy-back ExpressionList without porting the empty handling that the
 latter
 provided.

 Supporting explicit empty ordering on Window functions and slicing is
 arguably
 a foot-gun design due to how backends will return undeterministic results
 but
 this is a problem that requires a larger discussion.

 Refs #35064.

 Thanks Andrew Backer for the report and Mariusz for the review.

 Backport of 602fe961e6834d665f2359087a1272e9f9806b71 from main.
 }}}
-- 
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/010701914b115330-9bfb5b61-07ce-4d3a-9315-85614d908ecd-00%40eu-central-1.amazonses.com.


Re: [Django] #35665: Prefetch() fails with "OrderByList" when queryset has no order_by and is sliced

2024-08-13 Thread Django
#35665: Prefetch() fails with "OrderByList" when queryset has no order_by and is
sliced
-+-
 Reporter:  Andrew   |Owner:  Simon
 |  Charette
 Type:  Bug  |   Status:  closed
Component:  Database layer   |  Version:  5.1
  (models, ORM)  |
 Severity:  Release blocker  |   Resolution:  fixed
 Keywords:  prefetch slice   | Triage Stage:  Ready for
  order_by   |  checkin
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Changes (by Sarah Boyce <42296566+sarahboyce@…>):

 * resolution:   => fixed
 * status:  assigned => closed

Comment:

 In [changeset:"602fe961e6834d665f2359087a1272e9f9806b71" 602fe96]:
 {{{#!CommitTicketReference repository=""
 revision="602fe961e6834d665f2359087a1272e9f9806b71"
 Fixed #35665 -- Fixed a crash when passing an empty order_by to Window.

 This also caused un-ordered sliced prefetches to crash as they rely on
 Window.

 Regression in e16d0c176e9b89628cdec5e58c418378c4a2436a that made
 OrderByList
 piggy-back ExpressionList without porting the empty handling that the
 latter
 provided.

 Supporting explicit empty ordering on Window functions and slicing is
 arguably
 a foot-gun design due to how backends will return undeterministic results
 but
 this is a problem that requires a larger discussion.

 Refs #35064.

 Thanks Andrew Backer for the report and Mariusz for the review.
 }}}
-- 
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/010701914b0f53b1-cb285b08-80cb-4465-a821-956992c13a09-00%40eu-central-1.amazonses.com.


Re: [Django] #35665: Prefetch() fails with "OrderByList" when queryset has no order_by and is sliced

2024-08-12 Thread Django
#35665: Prefetch() fails with "OrderByList" when queryset has no order_by and is
sliced
-+-
 Reporter:  Andrew   |Owner:  Simon
 |  Charette
 Type:  Bug  |   Status:  assigned
Component:  Database layer   |  Version:  5.1
  (models, ORM)  |
 Severity:  Release blocker  |   Resolution:
 Keywords:  prefetch slice   | Triage Stage:  Ready for
  order_by   |  checkin
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Changes (by Sarah Boyce):

 * stage:  Accepted => Ready for checkin

-- 
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/01070191468490bc-e09e5b83-2c52-448a-bd0c-14640c2ad6bc-00%40eu-central-1.amazonses.com.


Re: [Django] #35665: Prefetch() fails with "OrderByList" when queryset has no order_by and is sliced

2024-08-11 Thread Django
#35665: Prefetch() fails with "OrderByList" when queryset has no order_by and is
sliced
-+-
 Reporter:  Andrew   |Owner:  Simon
 |  Charette
 Type:  Bug  |   Status:  assigned
Component:  Database layer   |  Version:  5.1
  (models, ORM)  |
 Severity:  Release blocker  |   Resolution:
 Keywords:  prefetch slice   | Triage Stage:  Accepted
  order_by   |
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Comment (by Andrew):

 Replying to [comment:2 Simon Charette]:

 Yes, it returns them in database order, which is acceptable in this case.

 This **actually** came up due to a Model having no {{{Meta.ordering}}},
 which is our standard.  All ordering must be explicit at the query level.
-- 
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/01070191448c62a1-1e2e52e6-1042-47c9-b11d-ac51fe647ef4-00%40eu-central-1.amazonses.com.


Re: [Django] #35665: Prefetch() fails with "OrderByList" when queryset has no order_by and is sliced

2024-08-09 Thread Django
#35665: Prefetch() fails with "OrderByList" when queryset has no order_by and is
sliced
-+-
 Reporter:  Andrew   |Owner:  Simon
 |  Charette
 Type:  Bug  |   Status:  assigned
Component:  Database layer   |  Version:  5.1
  (models, ORM)  |
 Severity:  Release blocker  |   Resolution:
 Keywords:  prefetch slice   | Triage Stage:  Accepted
  order_by   |
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/0107019137393b02-7627262f-e0b9-4d7b-8e5c-08b8cf0cad5f-00%40eu-central-1.amazonses.com.


Re: [Django] #35665: Prefetch() fails with "OrderByList" when queryset has no order_by and is sliced

2024-08-09 Thread Django
#35665: Prefetch() fails with "OrderByList" when queryset has no order_by and is
sliced
-+-
 Reporter:  Andrew   |Owner:  Simon
 |  Charette
 Type:  Bug  |   Status:  assigned
Component:  Database layer   |  Version:  5.1
  (models, ORM)  |
 Severity:  Release blocker  |   Resolution:
 Keywords:  prefetch slice   | Triage Stage:  Accepted
  order_by   |
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Changes (by Simon Charette):

 * keywords:  prefetch slice => prefetch slice order_by
 * owner:  (none) => Simon Charette
 * severity:  Normal => Release blocker
 * stage:  Unreviewed => Accepted
 * status:  new => assigned

Comment:

 I managed to reproduce and the issue the issue is relatively simple to
 address.

 It should obviously not crash but just so you know using slicing without
 ordering generally makes little sense as the backend is allowed to return
 rows in any order.
-- 
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/01070191370d7092-f19127e1-c393-41c6-b47e-0ffe5023d359-00%40eu-central-1.amazonses.com.