summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2023-05-09 10:54:10 -0400
committerMike Bayer <mike_mp@zzzcomputing.com>2023-05-09 10:54:10 -0400
commitddd25a03743543ed9a7f0a9516d3bfa2528b9fce (patch)
tree5b61eeeedbbb65b0d78684cceeeea87e71bc2f42
parenta7d8063171d87eef0f89e114e919ea8e07023db3 (diff)
downloadsqlalchemy-ddd25a03743543ed9a7f0a9516d3bfa2528b9fce.tar.gz
update errors page for greenlet error
the language here is adjusted to accommodate for newer patterns with lazy loading and asyncio, most prominently ``AsyncAtrs``. Change-Id: I9b2b9329158193f803c55c7e36dae16377e6c8e1
-rw-r--r--doc/build/errors.rst14
1 files changed, 7 insertions, 7 deletions
diff --git a/doc/build/errors.rst b/doc/build/errors.rst
index ea76a9914..2f2bfa91f 100644
--- a/doc/build/errors.rst
+++ b/doc/build/errors.rst
@@ -1282,7 +1282,6 @@ the ``prebuffer_rows`` execution option may be used as follows::
# context manager creates new Session
with Session(engine) as session_obj:
-
# result internally pre-fetches all objects
result = sess.execute(
select(User).where(User.id == 7), execution_options={"prebuffer_rows": True}
@@ -1364,7 +1363,6 @@ dataclass, such as in the example below::
class Mixin:
-
create_user: Mapped[int] = mapped_column()
update_user: Mapped[Optional[int]] = mapped_column(default=None, init=False)
@@ -1400,7 +1398,6 @@ The fix is to add :class:`_orm.MappedAsDataclass` to the signature of
``Mixin`` as well::
class Mixin(MappedAsDataclass):
-
create_user: Mapped[int] = mapped_column()
update_user: Mapped[Optional[int]] = mapped_column(default=None, init=False)
@@ -1500,14 +1497,17 @@ MissingGreenlet
A call to the async :term:`DBAPI` was initiated outside the greenlet spawn
context usually setup by the SQLAlchemy AsyncIO proxy classes. Usually this
-error happens when an IO was attempted in an unexpected place, without using
-the provided async api. When using the ORM this may be due to a lazy loading
-attempt, which is unsupported when using SQLAlchemy with AsyncIO dialects.
+error happens when an IO was attempted in an unexpected place, using a
+calling pattern that does not directly provide for use of the ``await`` keyword.
+When using the ORM this is nearly always due to the use of :term:`lazy loading`,
+which is not directly supported under asyncio without additional steps
+and/or alternate loader patterns in order to use successfully.
.. seealso::
:ref:`asyncio_orm_avoid_lazyloads` - covers most ORM scenarios where
- this problem can occur and how to mitigate.
+ this problem can occur and how to mitigate, including specific patterns
+ to use with lazy load scenarios.
.. _error_xd3s: