Skip to content

Commit

Permalink
Fix issue with old sqlalchemy.orm.Query usage (#719)
Browse files Browse the repository at this point in the history
  • Loading branch information
uriyyo authored Jun 27, 2023
1 parent 1a6a086 commit 78e0003
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion fastapi_pagination/ext/sqlalchemy.py
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,12 @@ def _old_paginate_sign(
stacklevel=3,
)

return query, query.session, params, transformer, additional_data, unique, subquery_count # type: ignore
session = query.session

with suppress(AttributeError):
query = query._statement_20() # type: ignore[attr-defined]

return query, session, params, transformer, additional_data, unique, subquery_count # type: ignore


def _new_paginate_sign(
Expand Down

0 comments on commit 78e0003

Please sign in to comment.