From 629d156e94f2f70f42582d7e86ae89b8f242d708 Mon Sep 17 00:00:00 2001 From: Mike Bayer Date: Mon, 30 Jan 2023 09:02:33 -0500 Subject: [PATCH] use scalars().one() for count migration so that the typed result is non-optional Fixes: #9184 Change-Id: I40e655010d08f795f3b835b9327ce50c6ec72135 (cherry picked from commit 956f152a29632afacacc4ea11dce1a54a7afb3ea) --- doc/build/changelog/migration_20.rst | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/doc/build/changelog/migration_20.rst b/doc/build/changelog/migration_20.rst index 7e567cbe60..8f7b45c3e4 100644 --- a/doc/build/changelog/migration_20.rst +++ b/doc/build/changelog/migration_20.rst @@ -1449,13 +1449,13 @@ following the table, and may include additional notes not summarized here. - :: - session.scalar( + session.scalars( select(func.count()). select_from(User) - ) - session.scalar( + ).one() + session.scalars( select(func.count(User.id)) - ) + ).one() - :meth:`_orm.Session.scalar` -- 2.47.2