Skip to content

Commit 9972845

Browse files
authored
[hdbcli] Clarify holdability possible values (#14410)
1 parent 003ff75 commit 9972845

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

stubs/hdbcli/hdbcli/__init__.pyi

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1+
from typing import Final
2+
13
from . import dbapi as dbapi
24

3-
__version__: str
5+
__version__: Final[str]
46

57
__all__ = ["dbapi"]

stubs/hdbcli/hdbcli/dbapi.pyi

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ class LOB:
5050
def write(self, object: str | bytes) -> int: ...
5151

5252
_Parameters: TypeAlias = Sequence[tuple[Any, ...]] | None
53+
_Holdability: TypeAlias = Literal[0, 1, 2, 3]
5354

5455
class Cursor:
5556
description: tuple[tuple[Any, ...], ...]
@@ -74,7 +75,7 @@ class Cursor:
7475
def fetchmany(self, size: int | None = ...) -> list[ResultRow]: ...
7576
def getrowsaffectedcounts(self) -> tuple[Any, ...]: ...
7677
def getpacketsize(self) -> int: ...
77-
def get_resultset_holdability(self) -> int: ...
78+
def get_resultset_holdability(self) -> _Holdability: ...
7879
def getwarning(self) -> Warning | None: ...
7980
def haswarning(self) -> bool: ...
8081
def clearwarning(self) -> None: ...
@@ -95,7 +96,7 @@ class Cursor:
9596
def setfetchsize(self, value: int) -> None: ...
9697
def setquerytimeout(self, value: int) -> None: ...
9798
def setpacketsize(self, value: int) -> None: ...
98-
def set_resultset_holdability(self, holdability: int) -> None: ...
99+
def set_resultset_holdability(self, holdability: _Holdability) -> None: ...
99100
def setoutputsize(self, *args: Any, **kwargs: Any) -> None: ...
100101
def setcommandinfo(self, command_info: str, line_number: int) -> None: ...
101102

0 commit comments

Comments
 (0)