Skip to content

Commit 226acd8

Browse files
authored
Improve engine.result (#98)
1 parent 3e85ed0 commit 226acd8

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

sqlalchemy-stubs/engine/result.pyi

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import sys
22
from typing import Any
3+
from typing import Callable
34
from typing import Iterable
45
from typing import Iterator
56
from typing import List
@@ -19,6 +20,8 @@ _TChunkedIteratorResult = TypeVar(
1920
"_TChunkedIteratorResult", bound=ChunkedIteratorResult
2021
)
2122

23+
def tuplegetter(*indexes: Any) -> Callable[[Any], Tuple[Any, ...]]: ...
24+
2225
class ResultMetaData:
2326
@property
2427
def keys(self) -> RMKeyView: ...
@@ -50,7 +53,7 @@ class _WithKeys:
5053
def keys(self) -> RMKeyView: ...
5154

5255
class Result(_WithKeys, ResultInternal):
53-
def __init__(self, cursor_metadata: Any) -> None: ...
56+
def __init__(self, cursor_metadata: ResultMetaData) -> None: ...
5457
def yield_per(self: _TResult, num: Any) -> _TResult: ...
5558
def unique(
5659
self: _TResult, strategy: Optional[object] = ...
@@ -134,7 +137,10 @@ class IteratorResult(Result):
134137
iterator: Any = ...
135138
raw: Any = ...
136139
def __init__(
137-
self, cursor_metadata: Any, iterator: Any, raw: Optional[Any] = ...
140+
self,
141+
cursor_metadata: ResultMetaData,
142+
iterator: Any,
143+
raw: Optional[Any] = ...,
138144
) -> None: ...
139145

140146
def null_result() -> IteratorResult: ...
@@ -146,7 +152,7 @@ class ChunkedIteratorResult(IteratorResult):
146152
dynamic_yield_per: Any = ...
147153
def __init__(
148154
self,
149-
cursor_metadata: Any,
155+
cursor_metadata: ResultMetaData,
150156
chunks: Any,
151157
source_supports_scalars: bool = ...,
152158
raw: Optional[Any] = ...,
@@ -158,5 +164,7 @@ class ChunkedIteratorResult(IteratorResult):
158164

159165
class MergedResult(IteratorResult):
160166
closed: bool = ...
161-
def __init__(self, cursor_metadata: Any, results: Result) -> None: ...
167+
def __init__(
168+
self, cursor_metadata: ResultMetaData, results: Result
169+
) -> None: ...
162170
def close(self) -> None: ...

0 commit comments

Comments
 (0)