[Django] #26815: Addition of Trunc may have altered the ordering of dates() queries

13 views
Skip to first unread message

Django

unread,
Jun 29, 2016, 6:52:44 AM6/29/16
to django-...@googlegroups.com
#26815: Addition of Trunc may have altered the ordering of dates() queries
----------------------------------------------+----------------------------
Reporter: Kazade | Owner: nobody
Type: Bug | Status: new
Component: Database layer (models, ORM) | Version: 1.10
Severity: Normal | Keywords: dates,
| queryset
Triage Stage: Unreviewed | Has patch: 0
Easy pickings: 0 | UI/UX: 0
----------------------------------------------+----------------------------
We're looking into supporting Django 1.10 in Djangae, and while fixing up
some breakages I noticed a change in the way that dates() queries are
ordered. I'm not 100% sure this is a real bug as I'm looking at the code
in a fairly abnormal situation, but it definitely seems like a bug...

This line was recently added as part of the datetime expression changes:

https://github.com/django/django/commit/2a4af0ea43512370764303d35bc5309f8abce666
#diff-5b0dda5eb9a242c15879dc9cd2121379R743

It seems to me that now, instead of ordering by the full date, this change
will make dates queries order by just the component that they are
selecting (e.g. year, month, day etc.) - although I might be wrong about
this!

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

Django

unread,
Jun 29, 2016, 8:04:33 AM6/29/16
to django-...@googlegroups.com
#26815: Addition of Trunc may have altered the ordering of dates() queries
-------------------------------------+-------------------------------------

Reporter: Kazade | Owner: nobody
Type: Bug | Status: new
Component: Database layer | Version: 1.10
(models, ORM) |
Severity: Normal | Resolution:

Keywords: dates, queryset | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by timgraham):

* needs_better_patch: => 0
* needs_tests: => 0
* needs_docs: => 0


Comment:

Could you provide example queries to demonstrate the bug?

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

Django

unread,
Jun 30, 2016, 9:54:12 AM6/30/16
to django-...@googlegroups.com
#26815: Addition of Trunc may have altered the ordering of dates() queries
-------------------------------------+-------------------------------------
Reporter: Kazade | Owner: nobody
Type: Bug | Status: closed

Component: Database layer | Version: 1.10
(models, ORM) |
Severity: Normal | Resolution: needsinfo

Keywords: dates, queryset | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by timgraham):

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


Comment:

Does
[https://github.com/django/django/blob/12b4280444b58c94197255655e284e4103fe00a9/tests/dates/tests.py#L70-L78
this assertion] show the expected behavior?

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

Django

unread,
Jun 30, 2016, 9:59:53 AM6/30/16
to django-...@googlegroups.com
#26815: Addition of Trunc may have altered the ordering of dates() queries
-------------------------------------+-------------------------------------
Reporter: Kazade | Owner: nobody

Type: Bug | Status: closed
Component: Database layer | Version: 1.10
(models, ORM) |
Severity: Normal | Resolution: needsinfo
Keywords: dates, queryset | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Kazade):

Yeah, that test proves I'm wrong. Sorry!

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

Django

unread,
Jun 30, 2016, 10:32:10 AM6/30/16
to django-...@googlegroups.com
#26815: Addition of Trunc may have altered the ordering of dates() queries
-------------------------------------+-------------------------------------
Reporter: Kazade | Owner: nobody

Type: Bug | Status: closed
Component: Database layer | Version: 1.10
(models, ORM) |
Severity: Normal | Resolution: invalid

Keywords: dates, queryset | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by timgraham):

* resolution: needsinfo => invalid


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

Reply all
Reply to author
Forward
0 new messages