Skip to content

Commit a11017c

Browse files
authored
Merge pull request #159 from kigawas/patch-1
Fix sqlalchemy subquery warning
2 parents ad9af70 + 95fbd72 commit a11017c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

fastapi_pagination/ext/async_sqlalchemy.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ async def paginate(
2020
) -> AbstractPage: # pragma: no cover # FIXME: fix coverage report generation
2121
params = resolve_params(params)
2222

23-
total = await session.scalar(select([func.count()]).select_from(query))
23+
total = await session.scalar(select(func.count()).select_from(query.subquery())) # type: ignore
2424
items = await session.execute(paginate_query(query, params))
2525

2626
return create_page([*items.scalars()], total, params)

0 commit comments

Comments
 (0)