Skip to content

Commit

Permalink
Fix issue with gino imports (#1282)
Browse files Browse the repository at this point in the history
  • Loading branch information
uriyyo authored Sep 13, 2024
1 parent 384d761 commit 8658274
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion fastapi_pagination/ext/sqlalchemy.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

from sqlalchemy import func, select, text
from sqlalchemy.exc import InvalidRequestError
from sqlalchemy.orm import FromStatement, Query, Session, noload, scoped_session
from sqlalchemy.orm import Query, Session, noload, scoped_session
from sqlalchemy.sql.elements import TextClause
from typing_extensions import TypeAlias, deprecated, no_type_check

Expand All @@ -32,6 +32,15 @@
from sqlalchemy.sql import Select


try:
from sqlalchemy.orm import FromStatement
except ImportError:

class FromStatement: # type: ignore
def __init__(self, *args: Any, **kwargs: Any) -> None:
raise ImportError("sqlalchemy.orm.FromStatement is not available")


try:
from sqlalchemy.util import await_only, greenlet_spawn
except ImportError: # pragma: no cover
Expand Down

0 comments on commit 8658274

Please sign in to comment.