]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
Fix async ORM example
authorGord Thompson <gord@gordthompson.com>
Wed, 6 Sep 2023 15:33:27 +0000 (09:33 -0600)
committerGord Thompson <gord@gordthompson.com>
Wed, 6 Sep 2023 15:33:27 +0000 (09:33 -0600)
Reverting change from b3216486 that causes error

sqlalchemy.exc.MultipleResultsFound: Multiple rows were found when exactly one was required

Change-Id: I9b249ff6e8e336f9c224e670359b4df99bc06092

examples/asyncio/async_orm.py

index eabc0250dee4496e2cdb6a582f411c97c0884500..592323be429f3a61399e338f95dac433a4c6b813 100644 (file)
@@ -96,7 +96,7 @@ async def async_main():
 
         result = await session.scalars(select(A).order_by(A.id))
 
-        a1 = result.one()
+        a1 = result.first()
 
         a1.data = "new data"