Re: [Django] #33705: IsNull() lookup cannot be used directly in filters.

19 views
Skip to first unread message

Django

unread,
May 13, 2022, 5:45:17 PM5/13/22
to django-...@googlegroups.com
#33705: IsNull() lookup cannot be used directly in filters.
-------------------------------------+-------------------------------------
Reporter: Florian Apolloner | Owner: nobody
Type: Bug | Status: new
Component: Database layer | Version: dev
(models, ORM) |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by David Wobrock):

* cc: David Wobrock (added)
* needs_better_patch: 0 => 1
* has_patch: 0 => 1


Comment:

Here is a draft [https://github.com/django/django/pull/15692 PR] with
failing tests.
Just a quick shot, trying to fix the issue with the approach of letting
the `IsNull` handle `Value` objects internally instead of `bool`s. But
that might have quite a large impact for such a small change.

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

Django

unread,
May 17, 2022, 8:36:29 AM5/17/22
to django-...@googlegroups.com
#33705: IsNull() lookup cannot be used directly in filters.
-------------------------------------+-------------------------------------
Reporter: Florian Apolloner | Owner: David
| Wobrock
Type: Bug | Status: assigned

Component: Database layer | Version: dev
(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 David Wobrock):

* owner: nobody => David Wobrock
* needs_better_patch: 1 => 0
* status: new => assigned


Comment:

I used the same [https://github.com/django/django/pull/15692 PR] but
changed the approach a bit.
It's the most straightforward approach I could think of. Let me know what
you think :)

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

Django

unread,
May 17, 2022, 1:01:43 PM5/17/22
to django-...@googlegroups.com
#33705: IsNull() lookup cannot be used directly in filters.
-------------------------------------+-------------------------------------
Reporter: Florian Apolloner | Owner: David
| Wobrock
Type: Bug | Status: assigned
Component: Database layer | Version: dev
(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
-------------------------------------+-------------------------------------

Comment (by Simon Charette):

Shouldn't this be considered a release blocker since it's a bug in a newly
released feature in Django 4.0?

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

Django

unread,
May 17, 2022, 2:45:01 PM5/17/22
to django-...@googlegroups.com
#33705: IsNull() lookup cannot be used directly in filters.
-------------------------------------+-------------------------------------
Reporter: Florian Apolloner | Owner: David
| Wobrock
Type: Bug | Status: assigned
Component: Database layer | Version: 4.0
(models, ORM) |
Severity: Release blocker | 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 Mariusz Felisiak):

* version: dev => 4.0
* severity: Normal => Release blocker


Comment:

Replying to [comment:4 Simon Charette]:


> Shouldn't this be considered a release blocker since it's a bug in a
newly released feature in Django 4.0?

Good catch! I missed that it's a new feature.

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

Django

unread,
May 19, 2022, 1:04:11 AM5/19/22
to django-...@googlegroups.com
#33705: IsNull() lookup cannot be used directly in filters.
-------------------------------------+-------------------------------------
Reporter: Florian Apolloner | Owner: David
| Wobrock
Type: Bug | Status: assigned
Component: Database layer | Version: 4.0
(models, ORM) |
Severity: Release blocker | Resolution:
Keywords: | Triage Stage: Ready for
| checkin

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

* stage: Accepted => Ready for checkin


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

Django

unread,
May 19, 2022, 1:52:53 AM5/19/22
to django-...@googlegroups.com
#33705: IsNull() lookup cannot be used directly in filters.
-------------------------------------+-------------------------------------
Reporter: Florian Apolloner | Owner: David
| Wobrock
Type: Bug | Status: closed

Component: Database layer | Version: 4.0
(models, ORM) |
Severity: Release blocker | Resolution: fixed

Keywords: | Triage Stage: Ready for
| checkin
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:"9f5548952906c6ea97200c016734b4f519520a64" 9f554895]:
{{{
#!CommitTicketReference repository=""
revision="9f5548952906c6ea97200c016734b4f519520a64"
Fixed #33705 -- Fixed crash when using IsNull() lookup in filters.

Thanks Florian Apolloner for the report.
Thanks Simon Charette for the review.
}}}

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

Django

unread,
May 19, 2022, 1:53:15 AM5/19/22
to django-...@googlegroups.com
#33705: IsNull() lookup cannot be used directly in filters.
-------------------------------------+-------------------------------------
Reporter: Florian Apolloner | Owner: David
| Wobrock
Type: Bug | Status: closed
Component: Database layer | Version: 4.0
(models, ORM) |
Severity: Release blocker | Resolution: fixed
Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Mariusz Felisiak <felisiak.mariusz@…>):

In [changeset:"820b4e565a06eddacf9a8038dd7b83784c6e99da" 820b4e56]:
{{{
#!CommitTicketReference repository=""
revision="820b4e565a06eddacf9a8038dd7b83784c6e99da"
[4.1.x] Fixed #33705 -- Fixed crash when using IsNull() lookup in filters.

Thanks Florian Apolloner for the report.
Thanks Simon Charette for the review.

Backport of 9f5548952906c6ea97200c016734b4f519520a64 from main
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/33705#comment:8>

Django

unread,
May 19, 2022, 1:53:40 AM5/19/22
to django-...@googlegroups.com
#33705: IsNull() lookup cannot be used directly in filters.
-------------------------------------+-------------------------------------
Reporter: Florian Apolloner | Owner: David
| Wobrock
Type: Bug | Status: closed
Component: Database layer | Version: 4.0
(models, ORM) |
Severity: Release blocker | Resolution: fixed
Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Mariusz Felisiak <felisiak.mariusz@…>):

In [changeset:"4a86883e0a7ed349d7ce3e91bde5e8e321effa1f" 4a86883e]:
{{{
#!CommitTicketReference repository=""
revision="4a86883e0a7ed349d7ce3e91bde5e8e321effa1f"
[4.0.x] Fixed #33705 -- Fixed crash when using IsNull() lookup in filters.

Thanks Florian Apolloner for the report.
Thanks Simon Charette for the review.

Backport of 9f5548952906c6ea97200c016734b4f519520a64 from main
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/33705#comment:9>

Reply all
Reply to author
Forward
0 new messages