#31056 closed Bug (fixed)
Add ability to override "async unsafe" checks.
| Reported by: | Andrew Godwin | Owned by: | Andrew Godwin |
|---|---|---|---|
| Component: | Core (Other) | Version: | dev |
| Severity: | Release blocker | Keywords: | |
| Cc: | Triage Stage: | Accepted | |
| Has patch: | yes | Needs documentation: | no |
| Needs tests: | no | Patch needs improvement: | no |
| Easy pickings: | no | UI/UX: | no |
Description
It's been reported that Jupyter, at least, executes apparently-synchronous code in an async environment (https://forum.djangoproject.com/t/is-there-a-way-to-disable-the-synchronousonlyoperation-check-when-using-the-orm-in-a-jupyter-notebook/548/3) and we're going to have people running headlong into this soon.
The "right" way of wrapping code in sync_to_async works, but is an undue burden on notebook authors as it would have to be in every cell, so it's suggested that we add a flag that disables the async-unsafe check. Either a setting or an environment variable could work; I slightly prefer an environment variable (as it's hard to forget about) provided this works well with Jupyter.
Change History (7)
comment:1 by , 6 years ago
| Has patch: | set |
|---|
comment:2 by , 6 years ago
| Triage Stage: | Unreviewed → Accepted |
|---|
comment:3 by , 6 years ago
| Has patch: | unset |
|---|---|
| Summary: | Add ability to override "async unsafe" checks → Add ability to override "async unsafe" checks. |
| Version: | 3.0 → master |
comment:4 by , 6 years ago
| Has patch: | set |
|---|
comment:5 by , 6 years ago
| Severity: | Normal → Release blocker |
|---|---|
| Type: | New feature → Bug |
Pull request: https://github.com/django/django/pull/12172