Skip to content

Commit

Permalink
AsyncSession: correct (stream_)scalars arg name (#238)
Browse files Browse the repository at this point in the history
  • Loading branch information
mjpieters authored Oct 11, 2022
1 parent a2e2d14 commit cf492ed
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions sqlalchemy-stubs/ext/asyncio/session.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -135,13 +135,13 @@ class _AsyncSessionProtocol(
async def scalars(
self,
statement: Executable,
parameters: Optional[_ExecuteParams] = ...,
params: Optional[_ExecuteParams] = ...,
execution_options: Optional[_ExecuteOptions] = ...,
) -> ScalarResult: ...
async def stream_scalars(
self,
statement: Executable,
parameters: Optional[_ExecuteParams] = ...,
params: Optional[_ExecuteParams] = ...,
execution_options: Optional[_ExecuteOptions] = ...,
) -> AsyncScalarResult: ...
async def delete(self, instance: Any) -> None: ...
Expand Down Expand Up @@ -211,13 +211,13 @@ class _AsyncSessionTypingCommon(
async def scalars(
self,
statement: Executable,
parameters: Optional[_ExecuteParams] = ...,
params: Optional[_ExecuteParams] = ...,
execution_options: Optional[_ExecuteOptions] = ...,
) -> ScalarResult: ...
async def stream_scalars(
self,
statement: Executable,
parameters: Optional[_ExecuteParams] = ...,
params: Optional[_ExecuteParams] = ...,
execution_options: Optional[_ExecuteOptions] = ...,
) -> AsyncScalarResult: ...
@classmethod
Expand Down
8 changes: 4 additions & 4 deletions test/files/async_stuff.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@


async def go() -> None:
r = await async_session.scalars(text("select 1"))
r = await async_session.scalars(text("select 1"), params=[])
r.first()
sr = await async_session.stream_scalars(text("select 1"))
sr = await async_session.stream_scalars(text("select 1"), params=[])
await sr.all()
r = await as_session.scalars(text("select 1"))
r = await as_session.scalars(text("select 1"), params=[])
r.first()
sr = await as_session.stream_scalars(text("select 1"))
sr = await as_session.stream_scalars(text("select 1"), params=[])
await sr.all()

async with engine.connect() as conn:
Expand Down

0 comments on commit cf492ed

Please sign in to comment.