[Django] #33646: Adding async interface to QuerySet.

61 views
Skip to first unread message

Django

unread,
Apr 15, 2022, 7:13:47 AM4/15/22
to django-...@googlegroups.com
#33646: Adding async interface to QuerySet.
-------------------------------------+-------------------------------------
Reporter: Mariusz | Owner: Andrew Godwin
Felisiak |
Type: New | Status: assigned
feature |
Component: Database | Version: 4.0
layer (models, ORM) |
Severity: Normal | Keywords: async
Triage Stage: Accepted | Has patch: 1
Needs documentation: 0 | Needs tests: 1
Patch needs improvement: 1 | Easy pickings: 0
UI/UX: 0 |
-------------------------------------+-------------------------------------
Adding async interface to ``QuerySet`` for all data access operations that
evaluate the queryset and are blocking calls.

See [https://github.com/django/deps/blob/main/accepted/0009-async.rst#the-
orm DEP-9].

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

Django

unread,
Apr 15, 2022, 7:14:59 AM4/15/22
to django-...@googlegroups.com
#33646: Adding async interface to QuerySet.
-------------------------------------+-------------------------------------
Reporter: Mariusz Felisiak | Owner: Andrew
| Godwin
Type: New feature | Status: assigned
Component: Database layer | Version: 4.0
(models, ORM) |
Severity: Normal | Resolution:

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

Comment (by Mariusz Felisiak):

[https://github.com/django/django/pull/14843 PR]

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

Django

unread,
Apr 20, 2022, 8:55:20 AM4/20/22
to django-...@googlegroups.com
#33646: Adding async interface to QuerySet.
-------------------------------------+-------------------------------------
Reporter: Mariusz Felisiak | Owner: Andrew
| Godwin
Type: New feature | Status: assigned
Component: Database layer | Version: 4.0
(models, ORM) |
Severity: Normal | Resolution:
Keywords: async | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 1 | Patch needs improvement: 1
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Carlton Gibson <carlton.gibson@…>):

In [changeset:"6b53114dd862ec97c282fdfdc83579cbd6d1560d" 6b53114]:
{{{
#!CommitTicketReference repository=""
revision="6b53114dd862ec97c282fdfdc83579cbd6d1560d"
Refs #33646 -- Added example for async cross-thread connection access.
}}}

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

Django

unread,
Apr 20, 2022, 8:57:34 AM4/20/22
to django-...@googlegroups.com
#33646: Adding async interface to QuerySet.
-------------------------------------+-------------------------------------
Reporter: Mariusz Felisiak | Owner: Andrew
| Godwin
Type: New feature | Status: assigned
Component: Database layer | Version: 4.0
(models, ORM) |
Severity: Normal | Resolution:
Keywords: async | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 1 | Patch needs improvement: 1
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Carlton Gibson <carlton.gibson@…>):

In [changeset:"86324f37b3ce0b1fb3973c10f2e1e4655b5680cd" 86324f37]:
{{{
#!CommitTicketReference repository=""
revision="86324f37b3ce0b1fb3973c10f2e1e4655b5680cd"
[4.0.x] Refs #33646 -- Added example for async cross-thread connection
access.

Backport of 6b53114dd862ec97c282fdfdc83579cbd6d1560d from main
}}}

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

Django

unread,
Apr 21, 2022, 1:00:40 AM4/21/22
to django-...@googlegroups.com
#33646: Adding async interface to QuerySet.
-------------------------------------+-------------------------------------
Reporter: Mariusz Felisiak | Owner: Andrew
| Godwin
Type: New feature | Status: assigned
Component: Database layer | Version: 4.0
(models, ORM) |
Severity: Normal | Resolution:
Keywords: async | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1

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

* needs_tests: 1 => 0


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

Django

unread,
Apr 26, 2022, 2:31:19 PM4/26/22
to django-...@googlegroups.com
#33646: Adding async interface to QuerySet.
-------------------------------------+-------------------------------------
Reporter: Mariusz Felisiak | Owner: Andrew
| Godwin
Type: New feature | Status: assigned
Component: Database layer | Version: 4.0
(models, ORM) |
Severity: Normal | Resolution:
Keywords: async | 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):

* needs_better_patch: 1 => 0
* stage: Accepted => Ready for checkin


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

Django

unread,
Apr 27, 2022, 2:54:00 AM4/27/22
to django-...@googlegroups.com
#33646: Adding async interface to QuerySet.
-------------------------------------+-------------------------------------
Reporter: Mariusz Felisiak | Owner: Andrew
| Godwin
Type: New feature | Status: closed

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

Keywords: async | 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:"58b27e0dbb3d31ca1438790870b2b51ecdb10500" 58b27e0d]:
{{{
#!CommitTicketReference repository=""
revision="58b27e0dbb3d31ca1438790870b2b51ecdb10500"
Fixed #33646 -- Added async-compatible interface to QuerySet.

Thanks Simon Charette for reviews.

Co-authored-by: Carlton Gibson <carlton...@noumenal.es>
Co-authored-by: Mariusz Felisiak <felisiak...@gmail.com>
}}}

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

Django

unread,
May 2, 2022, 4:53:24 AM5/2/22
to django-...@googlegroups.com
#33646: Adding async interface to QuerySet.
-------------------------------------+-------------------------------------
Reporter: Mariusz Felisiak | Owner: Andrew
| Godwin
Type: New feature | Status: closed
Component: Database layer | Version: 4.0
(models, ORM) |
Severity: Normal | Resolution: fixed
Keywords: async | 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:"271a8e73ee382bb487d15e97ffaa675d78869413" 271a8e7]:
{{{
#!CommitTicketReference repository=""
revision="271a8e73ee382bb487d15e97ffaa675d78869413"
Refs #33646 -- Made QuerySet.raw() async-compatible.
}}}

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

Django

unread,
May 2, 2022, 4:53:24 AM5/2/22
to django-...@googlegroups.com
#33646: Adding async interface to QuerySet.
-------------------------------------+-------------------------------------
Reporter: Mariusz Felisiak | Owner: Andrew
| Godwin
Type: New feature | Status: closed
Component: Database layer | Version: 4.0
(models, ORM) |
Severity: Normal | Resolution: fixed
Keywords: async | 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:"77926176b281b9c553c934e52acdd1c0377ea601" 77926176]:
{{{
#!CommitTicketReference repository=""
revision="77926176b281b9c553c934e52acdd1c0377ea601"
Refs #33646 -- Added RawModelIterable.
}}}

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

Django

unread,
May 4, 2022, 2:32:24 AM5/4/22
to django-...@googlegroups.com
#33646: Adding async interface to QuerySet.
-------------------------------------+-------------------------------------
Reporter: Mariusz Felisiak | Owner: Andrew
| Godwin
Type: New feature | Status: closed
Component: Database layer | Version: 4.0
(models, ORM) |
Severity: Normal | Resolution: fixed
Keywords: async | 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 GitHub <noreply@…>):

In [changeset:"1109e669905d2011561e843f0ab7c2c02fb63c4d" 1109e669]:
{{{
#!CommitTicketReference repository=""
revision="1109e669905d2011561e843f0ab7c2c02fb63c4d"
Refs #33646 -- Reduced sync_to_async hops on async QuerySet iteration.

Until we add support for truly asynchronous database backends it's
actually detrimental to have complete set retrieval require multiple
hops between sync and async emulated contexts via asgiref.

By defaulting to sending the whole sync _fetch_all() to the current
context thread pool we reduce unncessary work when dealing with large
result sets since the queryset cannot be iterated anyway before all
results are retrieved and cached.
}}}

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

Django

unread,
May 18, 2022, 11:40:54 AM5/18/22
to django-...@googlegroups.com
#33646: Adding async interface to QuerySet.
-------------------------------------+-------------------------------------
Reporter: Mariusz Felisiak | Owner: Andrew
| Godwin
Type: New feature | Status: closed
Component: Database layer | Version: 4.0
(models, ORM) |
Severity: Normal | Resolution: fixed
Keywords: async | 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 Carlton Gibson <carlton@…>):

In [changeset:"4525d689e9ad4667e1798004c25053966c73c2d2" 4525d689]:
{{{
#!CommitTicketReference repository=""
revision="4525d689e9ad4667e1798004c25053966c73c2d2"
Refs #33646 -- Fixed link markup in queries topic doc.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/33646#comment:10>

Django

unread,
May 18, 2022, 11:42:00 AM5/18/22
to django-...@googlegroups.com
#33646: Adding async interface to QuerySet.
-------------------------------------+-------------------------------------
Reporter: Mariusz Felisiak | Owner: Andrew
| Godwin
Type: New feature | Status: closed
Component: Database layer | Version: 4.0
(models, ORM) |
Severity: Normal | Resolution: fixed
Keywords: async | 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 Carlton Gibson <carlton.gibson@…>):

In [changeset:"aa3197e5f11f33aef22f4d5a1fe711501bfbc49c" aa3197e5]:
{{{
#!CommitTicketReference repository=""
revision="aa3197e5f11f33aef22f4d5a1fe711501bfbc49c"
[4.1.x] Refs #33646 -- Fixed link markup in queries topic doc.

Backport of 4525d689e9ad4667e1798004c25053966c73c2d2 from main
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/33646#comment:11>

Django

unread,
Nov 3, 2022, 3:11:36 PM11/3/22
to django-...@googlegroups.com
#33646: Adding async interface to QuerySet.
-------------------------------------+-------------------------------------
Reporter: Mariusz Felisiak | Owner: Andrew
| Godwin
Type: New feature | Status: closed
Component: Database layer | Version: 4.0
(models, ORM) |
Severity: Normal | Resolution: fixed
Keywords: async | 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 GitHub <noreply@…>):

In [changeset:"e580b891cb5ae31eb0571c88428afb9bf69e47f2" e580b89]:
{{{
#!CommitTicketReference repository=""
revision="e580b891cb5ae31eb0571c88428afb9bf69e47f2"
Refs #33646 -- Moved tests of QuerySet async interface into async tests.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/33646#comment:12>

Django

unread,
Nov 8, 2022, 2:14:48 AM11/8/22
to django-...@googlegroups.com
#33646: Adding async interface to QuerySet.
-------------------------------------+-------------------------------------
Reporter: Mariusz Felisiak | Owner: Andrew
| Godwin
Type: New feature | Status: closed
Component: Database layer | Version: 4.0
(models, ORM) |
Severity: Normal | Resolution: fixed
Keywords: async | 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:"8740d2f452186b30374bf29240144a5048ae0eb4" 8740d2f4]:
{{{
#!CommitTicketReference repository=""
revision="8740d2f452186b30374bf29240144a5048ae0eb4"
[4.1.x] Refs #33646 -- Moved tests of QuerySet async interface into async
tests.

Backport of e580b891cb5ae31eb0571c88428afb9bf69e47f2 from main
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/33646#comment:13>

Reply all
Reply to author
Forward
0 new messages