diff options
Diffstat (limited to 'lib/sqlalchemy/ext/asyncio/session.py')
-rw-r--r-- | lib/sqlalchemy/ext/asyncio/session.py | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/lib/sqlalchemy/ext/asyncio/session.py b/lib/sqlalchemy/ext/asyncio/session.py index be3414cef..ea587f8de 100644 --- a/lib/sqlalchemy/ext/asyncio/session.py +++ b/lib/sqlalchemy/ext/asyncio/session.py @@ -7,6 +7,7 @@ from __future__ import annotations from typing import Any +from typing import Callable from typing import Dict from typing import Generic from typing import Iterable @@ -33,7 +34,6 @@ from ...orm import Session from ...orm import SessionTransaction from ...orm import state as _instance_state from ...util.concurrency import greenlet_spawn -from ...util.typing import Protocol if TYPE_CHECKING: from .engine import AsyncConnection @@ -68,11 +68,6 @@ _AsyncSessionBind = Union["AsyncEngine", "AsyncConnection"] _T = TypeVar("_T", bound=Any) -class _SyncSessionCallable(Protocol): - def __call__(self, session: Session, *arg: Any, **kw: Any) -> Any: - ... - - _EXECUTE_OPTIONS = util.immutabledict({"prebuffer_rows": True}) _STREAM_OPTIONS = util.immutabledict({"stream_results": True}) @@ -234,7 +229,7 @@ class AsyncSession(ReversibleProxy[Session]): ) async def run_sync( - self, fn: _SyncSessionCallable, *arg: Any, **kw: Any + self, fn: Callable[..., Any], *arg: Any, **kw: Any ) -> Any: """Invoke the given sync callable passing sync self as the first argument. |