[Django] #23659: Lost annotation ordering with values_list() and annotate()

19 views
Skip to first unread message

Django

unread,
Oct 15, 2014, 9:50:44 AM10/15/14
to django-...@googlegroups.com
#23659: Lost annotation ordering with values_list() and annotate()
-------------------------------------+-------------------------------------
Reporter: claudep | Owner: nobody
Type: Bug | Status: new
Component: Database | Version: 1.7
layer (models, ORM) | Keywords:
Severity: Normal | Has patch: 0
Triage Stage: | Needs tests: 0
Unreviewed | Easy pickings: 0
Needs documentation: 0 |
Patch needs improvement: 0 |
UI/UX: 0 |
-------------------------------------+-------------------------------------
When I'm aggregating with `values_list()` and then annotate with a list of
clauses, I'd expect the annotate *args ordering to be respected in the
resulting lists. Unfortunately, `annotate()` args ordering is currently
discarded because all annotations parameters are consolidated in a plain
`dict`.

--
Ticket URL: <https://code.djangoproject.com/ticket/23659>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Oct 15, 2014, 9:53:52 AM10/15/14
to django-...@googlegroups.com
#23659: Lost annotation ordering with values_list() and annotate()
-------------------------------------+-------------------------------------
Reporter: claudep | Owner: nobody
Type: Bug | Status: new
Component: Database layer | Version: 1.7
(models, ORM) | Resolution:
Severity: Normal | Triage Stage:
Keywords: | Unreviewed
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by claudep):

* has_patch: 0 => 1


Comment:

https://github.com/django/django/pull/3371

--
Ticket URL: <https://code.djangoproject.com/ticket/23659#comment:1>

Django

unread,
Oct 15, 2014, 11:10:38 AM10/15/14
to django-...@googlegroups.com
#23659: Lost annotation ordering with values_list() and annotate()
-------------------------------------+-------------------------------------
Reporter: claudep | Owner: nobody
Type: Bug | Status: new
Component: Database layer | Version: master
(models, ORM) | Resolution:
Severity: Normal | Triage Stage: Ready for
Keywords: | checkin

Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by charettes):

* version: 1.7 => master
* stage: Unreviewed => Ready for checkin


Comment:

It's also what I would expect from `values_list()` and `annotate()`
chaining.

Patch LGTM, CI failures look unrelated.

--
Ticket URL: <https://code.djangoproject.com/ticket/23659#comment:2>

Django

unread,
Oct 15, 2014, 1:29:38 PM10/15/14
to django-...@googlegroups.com
#23659: Lost annotation ordering with values_list() and annotate()
-------------------------------------+-------------------------------------
Reporter: claudep | Owner: nobody
Type: Bug | Status: new
Component: Database layer | Version: master
(models, ORM) | Resolution:
Severity: Normal | Triage Stage: Accepted
Keywords: | Needs documentation: 0
Has patch: 1 | Patch needs improvement: 0
Needs tests: 0 | UI/UX: 0
Easy pickings: 0 |
-------------------------------------+-------------------------------------
Changes (by charettes):

* stage: Ready for checkin => Accepted


Comment:

Loïc raised an issue on the PR that must be addressed before merging.

--
Ticket URL: <https://code.djangoproject.com/ticket/23659#comment:3>

Django

unread,
Oct 15, 2014, 3:19:48 PM10/15/14
to django-...@googlegroups.com
#23659: Lost annotation ordering with values_list() and annotate()
-------------------------------------+-------------------------------------
Reporter: claudep | Owner: nobody
Type: Bug | Status: new
Component: Database layer | Version: master
(models, ORM) | Resolution:
Severity: Normal | Triage Stage: Accepted
Keywords: | Needs documentation: 0
Has patch: 1 | Patch needs improvement: 0
Needs tests: 0 | UI/UX: 0
Easy pickings: 0 |
-------------------------------------+-------------------------------------

Comment (by claudep):

Issue addressed, test suite OK.

--
Ticket URL: <https://code.djangoproject.com/ticket/23659#comment:4>

Django

unread,
Oct 15, 2014, 4:41:27 PM10/15/14
to django-...@googlegroups.com
#23659: Lost annotation ordering with values_list() and annotate()
-------------------------------------+-------------------------------------
Reporter: claudep | Owner: nobody
Type: Bug | Status: new
Component: Database layer | Version: master
(models, ORM) | Resolution:
Severity: Normal | Triage Stage: Ready for
Keywords: | checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by charettes):

* stage: Accepted => Ready for checkin


Comment:

Except the two flake8 warnings the patch is RFC.

--
Ticket URL: <https://code.djangoproject.com/ticket/23659#comment:5>

Django

unread,
Oct 16, 2014, 3:28:11 AM10/16/14
to django-...@googlegroups.com
#23659: Lost annotation ordering with values_list() and annotate()
-------------------------------------+-------------------------------------
Reporter: claudep | Owner: nobody
Type: Bug | Status: closed

Component: Database layer | Version: master
(models, ORM) | Resolution: fixed

Severity: Normal | Triage Stage: Ready for
Keywords: | checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Claude Paroz <claude@…>):

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


Comment:

In [changeset:"374c14b7fd8a7ba06cebfa83dd40915a50796d3e"]:
{{{
#!CommitTicketReference repository=""
revision="374c14b7fd8a7ba06cebfa83dd40915a50796d3e"
Fixed #23659 -- Kept annotate() args ordering

Thanks Loic Bistuer and Simon Charette for the review.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/23659#comment:6>

Reply all
Reply to author
Forward
0 new messages