[Django] #27995: Raise a descriptive error on unsupported operations following QuerySet.union()

15 views
Skip to first unread message

Django

unread,
Mar 29, 2017, 9:55:09 AM3/29/17
to django-...@googlegroups.com
#27995: Raise a descriptive error on unsupported operations following
QuerySet.union()
-------------------------------------+-------------------------------------
Reporter: Tim | Owner: nobody
Graham |
Type: | Status: new
Cleanup/optimization |
Component: Database | Version: 1.10
layer (models, ORM) |
Severity: Normal | Keywords:
Triage Stage: Accepted | Has patch: 0
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
-------------------------------------+-------------------------------------
The documentation for `QuerySet.union()` says, "In addition, only LIMIT,
OFFSET, and ORDER BY (i.e. slicing and order_by()) are allowed on the
resulting QuerySet.", however, there isn't any strict enforcement about
this -- some operations like `QuerySet.count()` might appear to work. See
#27982 and #27990 for confusion about this.

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

Django

unread,
Mar 29, 2017, 9:55:17 AM3/29/17
to django-...@googlegroups.com
#27995: Raise a descriptive error on unsupported operations following
QuerySet.union()
-------------------------------------+-------------------------------------
Reporter: Tim Graham | Owner: nobody
Type: | Status: new
Cleanup/optimization |
Component: Database layer | Version: 1.10
(models, ORM) |
Severity: Normal | Resolution:

Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Tim Graham):

[https://github.com/django/django/pull/7741 WIP PR] from Florian.

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

Django

unread,
Apr 4, 2017, 4:54:45 AM4/4/17
to django-...@googlegroups.com
#27995: Raise a descriptive error on unsupported operations following
QuerySet.union()
-------------------------------------+-------------------------------------
Reporter: Tim Graham | Owner: kapil
Type: | garg
Cleanup/optimization | Status: assigned

Component: Database layer | Version: 1.10
(models, ORM) |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by kapil garg):

* status: new => assigned
* owner: nobody => kapil garg


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

Django

unread,
Jun 20, 2017, 12:25:20 PM6/20/17
to django-...@googlegroups.com
#27995: Raise a descriptive error on unsupported operations following
QuerySet.union(), intersection(), and difference()

-------------------------------------+-------------------------------------
Reporter: Tim Graham | Owner: kapil
Type: | garg
Cleanup/optimization | Status: assigned
Component: Database layer | Version: 1.10
(models, ORM) |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Tim Graham):

I closed #28328 as a duplicate -- the case of trying to use `only()` after
difference.

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

Django

unread,
May 7, 2019, 7:42:22 AM5/7/19
to django-...@googlegroups.com
#27995: Raise a descriptive error on unsupported operations following
QuerySet.union(), intersection(), and difference().

-------------------------------------+-------------------------------------
Reporter: Tim Graham | Owner: kapil
Type: | garg
Cleanup/optimization | Status: assigned
Component: Database layer | Version: master

(models, ORM) |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by felixxm):

* version: 1.10 => master


Comment:

I closed #30456 as an invalid -- the case of trying to use
`select_related()` after `union()`.

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

Django

unread,
May 30, 2019, 4:21:14 PM5/30/19
to django-...@googlegroups.com
#27995: Raise a descriptive error on unsupported operations following
QuerySet.union(), intersection(), and difference().
-------------------------------------+-------------------------------------
Reporter: Tim Graham | Owner: nobody
Type: | Status: new
Cleanup/optimization |

Component: Database layer | Version: master
(models, ORM) |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by felixxm):

I closed #30532 as a duplicate -- the case of trying to use `filter()` and
`exclude()` after `union()`.

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

Django

unread,
Jul 24, 2019, 12:03:02 PM7/24/19
to django-...@googlegroups.com
#27995: Raise a descriptive error on unsupported operations following
QuerySet.union(), intersection(), and difference().
-------------------------------------+-------------------------------------
Reporter: Tim Graham | Owner: Hasan
Type: | Ramezani
Cleanup/optimization | Status: assigned

Component: Database layer | Version: master
(models, ORM) |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Hasan Ramezani):

* status: new => assigned

* owner: nobody => Hasan Ramezani
* has_patch: 0 => 1


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

Django

unread,
Jul 25, 2019, 6:59:20 AM7/25/19
to django-...@googlegroups.com
#27995: Raise a descriptive error on unsupported operations following
QuerySet.union(), intersection(), and difference().
-------------------------------------+-------------------------------------
Reporter: Tim Graham | Owner: Hasan
Type: | Ramezani
Cleanup/optimization | Status: closed

Component: Database layer | Version: master
(models, ORM) |
Severity: Normal | Resolution: fixed
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Mariusz Felisiak <felisiak.mariusz@…>):

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


Comment:

In [changeset:"1853383969a4c53bbeba998757c30410bd3df4bb" 18533839]:
{{{
#!CommitTicketReference repository=""
revision="1853383969a4c53bbeba998757c30410bd3df4bb"
Fixed #27995 -- Added error messages on unsupported operations following
union(), intersection(), and difference().
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/27995#comment:7>

Reply all
Reply to author
Forward
0 new messages