From 8dfc2c3f48f2c72891c3ed22ea46787640d65f08 Mon Sep 17 00:00:00 2001 From: Kai Harder Date: Wed, 28 Jan 2026 09:25:12 +0000 Subject: [PATCH 1/5] Add async types to hdbcli --- stubs/hdbcli/METADATA.toml | 2 +- stubs/hdbcli/hdbcli/dbapi.pyi | 47 +++++++++++++++++++++++++++++++++++ 2 files changed, 48 insertions(+), 1 deletion(-) diff --git a/stubs/hdbcli/METADATA.toml b/stubs/hdbcli/METADATA.toml index 168d2786a79a..c7d8c8e65386 100644 --- a/stubs/hdbcli/METADATA.toml +++ b/stubs/hdbcli/METADATA.toml @@ -1,2 +1,2 @@ -version = "2.25.*" +version = "2.27.*" # upstream_repository = closed-source diff --git a/stubs/hdbcli/hdbcli/dbapi.pyi b/stubs/hdbcli/hdbcli/dbapi.pyi index 8cccb842afe8..6daf7f1c54ca 100644 --- a/stubs/hdbcli/hdbcli/dbapi.pyi +++ b/stubs/hdbcli/hdbcli/dbapi.pyi @@ -141,3 +141,50 @@ DATETIME: type[date | time | datetime] STRING = str BINARY = memoryview ROWID = int + +class AsyncConnection(Connection): + @classmethod + async def create( + cls, + address: str = "", + port: int = 0, + user: str = "", + password: str = "", + autocommit: bool = True, + packetsize: int | None = None, + userkey: str | None = ..., + *, + sessionvariables: dict[str, str] | None = ..., + forcebulkfetch: bool | None = ..., + ) -> Self: ... + async def cancel(self) -> bool: ... + async def close(self) -> None: ... + async def commit(self) -> None: ... + async def cursor(self) -> AsyncCursor: ... + async def rollback(self) -> None: ... + +class AsyncCursor(Cursor): + async def callproc(self, procname: str, parameters: tuple[Any, ...] = ..., overview: bool = ...) -> tuple[Any, ...]: ... + async def close(self) -> None: ... + async def execute(self, operation: str, parameters: tuple[Any, ...] | None = ...) -> bool: ... + async def executemany(self, operation: str, parameters: _Parameters = ..., batcherrors: bool = False) -> Any: ... + async def executemanyprepared(self, parameters: _Parameters = ...) -> Any: ... + async def executeprepared(self, parameters: _Parameters = ...) -> Any: ... + async def fetchone(self, uselob: bool = ...) -> ResultRow | None: ... + async def fetchall(self) -> list[ResultRow]: ... + async def fetchmany(self, size: int | None = ...) -> list[ResultRow]: ... + async def nextset(self) -> None: ... + async def prepare(self, operation: str, newcursor: bool = ...) -> Any: ... + async def scroll(self, value: int, mode: Literal["absolute", "relative"] = ...) -> None: ... + async def __aenter__(self) -> Self: ... + async def __aexit__(self, typ: type[BaseException] | None, val: BaseException | None, tb: TracebackType | None) -> None: ... + +class AsyncLob(LOB): + async def close(self) -> None: ... + async def find(self, object: str, length: int, position: int = ...) -> int: ... + async def read(self, size: int = ..., position: int = ...) -> str | bytes: ... + async def write(self, object: str | bytes) -> int: ... + +async_connect = AsyncConnection + +def set_async_mode(enabled: bool = True) -> None: ... From 41e109a1b9591f83a95b477fe87356a71ef6a16b Mon Sep 17 00:00:00 2001 From: Kai Harder Date: Tue, 14 Jul 2026 06:48:41 +0000 Subject: [PATCH 2/5] Fix --- stubs/hdbcli/hdbcli/dbapi.pyi | 36 +++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/stubs/hdbcli/hdbcli/dbapi.pyi b/stubs/hdbcli/hdbcli/dbapi.pyi index 2f9d7773fb32..332c4e0eef7e 100644 --- a/stubs/hdbcli/hdbcli/dbapi.pyi +++ b/stubs/hdbcli/hdbcli/dbapi.pyi @@ -159,33 +159,33 @@ class AsyncConnection(Connection): sessionvariables: dict[str, str] | None = ..., forcebulkfetch: bool | None = ..., ) -> Self: ... - async def cancel(self) -> bool: ... - async def close(self) -> None: ... - async def commit(self) -> None: ... - async def cursor(self) -> AsyncCursor: ... - async def rollback(self) -> None: ... + async def cancel(self) -> bool: ... # type: ignore[override] + async def close(self) -> None: ... # type: ignore[override] + async def commit(self) -> None: ... # type: ignore[override] + async def cursor(self) -> AsyncCursor: ... # type: ignore[override] + async def rollback(self) -> None: ... # type: ignore[override] class AsyncCursor(Cursor): - async def callproc(self, procname: str, parameters: tuple[Any, ...] = ..., overview: bool = ...) -> tuple[Any, ...]: ... - async def close(self) -> None: ... - async def execute(self, operation: str, parameters: tuple[Any, ...] | None = ...) -> bool: ... + async def callproc(self, procname: str, parameters: tuple[Any, ...] = ..., overview: bool = ...) -> tuple[Any, ...]: ... # type: ignore[override] + async def close(self) -> None: ... # type: ignore[override] + async def execute(self, operation: str, parameters: tuple[Any, ...] | None = ...) -> bool: ... # type: ignore[override] async def executemany(self, operation: str, parameters: _Parameters = ..., batcherrors: bool = False) -> Any: ... async def executemanyprepared(self, parameters: _Parameters = ...) -> Any: ... async def executeprepared(self, parameters: _Parameters = ...) -> Any: ... - async def fetchone(self, uselob: bool = ...) -> ResultRow | None: ... - async def fetchall(self) -> list[ResultRow]: ... - async def fetchmany(self, size: int | None = ...) -> list[ResultRow]: ... - async def nextset(self) -> None: ... - async def prepare(self, operation: str, newcursor: bool = ...) -> Any: ... - async def scroll(self, value: int, mode: Literal["absolute", "relative"] = ...) -> None: ... + async def fetchone(self, uselob: bool = ...) -> ResultRow | None: ... # type: ignore[override] + async def fetchall(self) -> list[ResultRow]: ... # type: ignore[override] + async def fetchmany(self, size: int | None = ...) -> list[ResultRow]: ... # type: ignore[override] + async def nextset(self) -> None: ... # type: ignore[override] + async def prepare(self, operation: str, newcursor: bool = ...) -> Any: ... # type: ignore[override] + async def scroll(self, value: int, mode: Literal["absolute", "relative"] = ...) -> None: ... # type: ignore[override] async def __aenter__(self) -> Self: ... async def __aexit__(self, typ: type[BaseException] | None, val: BaseException | None, tb: TracebackType | None) -> None: ... class AsyncLob(LOB): - async def close(self) -> None: ... - async def find(self, object: str, length: int, position: int = ...) -> int: ... - async def read(self, size: int = ..., position: int = ...) -> str | bytes: ... - async def write(self, object: str | bytes) -> int: ... + async def close(self) -> None: ... # type: ignore[override] + async def find(self, object: str, length: int, position: int = ...) -> int: ... # type: ignore[override] + async def read(self, size: int = ..., position: int = ...) -> str | bytes: ... # type: ignore[override] + async def write(self, object: str | bytes) -> int: ... # type: ignore[override] async_connect = AsyncConnection From ef88459f6cc675ae49373f8e09b585075689f171 Mon Sep 17 00:00:00 2001 From: Kai Harder Date: Tue, 14 Jul 2026 10:15:38 +0000 Subject: [PATCH 3/5] Fix --- stubs/hdbcli/@tests/stubtest_allowlist.txt | 13 +++++++++++++ stubs/hdbcli/METADATA.toml | 2 +- stubs/hdbcli/hdbcli/dbapi.pyi | 3 ++- 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/stubs/hdbcli/@tests/stubtest_allowlist.txt b/stubs/hdbcli/@tests/stubtest_allowlist.txt index e13c2f2b127b..3288c1328d2f 100644 --- a/stubs/hdbcli/@tests/stubtest_allowlist.txt +++ b/stubs/hdbcli/@tests/stubtest_allowlist.txt @@ -8,3 +8,16 @@ hdbcli.dbapi.ExecuteManyErrorEntry.rownumber hdbcli.dbapi.buffer hdbcli.dbapi.long hdbcli.dbapi.unicode + +# async_connect is an alias for AsyncConnection, but at runtime its a function +hdbcli.dbapi.async_connect + +# *args/**kwargs are not added by purpose but are part of the python wrapper +hdbcli.dbapi.AsyncLob.close +hdbcli.dbapi.AsyncCursor.nextset +hdbcli.dbapi.AsyncCursor.fetchall +hdbcli.dbapi.AsyncCursor.close +hdbcli.dbapi.AsyncConnection.rollback +hdbcli.dbapi.AsyncConnection.commit +hdbcli.dbapi.AsyncConnection.close +hdbcli.dbapi.AsyncConnection.cancel \ No newline at end of file diff --git a/stubs/hdbcli/METADATA.toml b/stubs/hdbcli/METADATA.toml index a420f3c42978..2bc0cad45c11 100644 --- a/stubs/hdbcli/METADATA.toml +++ b/stubs/hdbcli/METADATA.toml @@ -1,2 +1,2 @@ -version = "2.27.*" +version = "2.29.*" # upstream-repository = closed-source diff --git a/stubs/hdbcli/hdbcli/dbapi.pyi b/stubs/hdbcli/hdbcli/dbapi.pyi index 332c4e0eef7e..a0370ffa861d 100644 --- a/stubs/hdbcli/hdbcli/dbapi.pyi +++ b/stubs/hdbcli/hdbcli/dbapi.pyi @@ -40,6 +40,7 @@ class Connection: def setautocommit(self, auto: bool = ...) -> None: ... def setclientinfo(self, key: str, value: str | None = ...) -> None: ... def ontrace(self, callback: Callable[[str], Any], options: str = ...) -> None: ... + def ping(self) -> bool: ... connect = Connection @@ -83,7 +84,7 @@ class Cursor: def haswarning(self) -> bool: ... def clearwarning(self) -> None: ... def has_result_set(self) -> bool: ... - def nextset(self) -> None: ... + def nextset(self, *args, **kwargs) -> None: ... def parameter_description(self) -> tuple[str, ...]: ... @overload From 5e249d989132dd910b9cb8c902a274f9ffc95352 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 14 Jul 2026 10:17:44 +0000 Subject: [PATCH 4/5] [pre-commit.ci] auto fixes from pre-commit.com hooks --- stubs/hdbcli/@tests/stubtest_allowlist.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stubs/hdbcli/@tests/stubtest_allowlist.txt b/stubs/hdbcli/@tests/stubtest_allowlist.txt index 3288c1328d2f..0a8477f582f6 100644 --- a/stubs/hdbcli/@tests/stubtest_allowlist.txt +++ b/stubs/hdbcli/@tests/stubtest_allowlist.txt @@ -20,4 +20,4 @@ hdbcli.dbapi.AsyncCursor.close hdbcli.dbapi.AsyncConnection.rollback hdbcli.dbapi.AsyncConnection.commit hdbcli.dbapi.AsyncConnection.close -hdbcli.dbapi.AsyncConnection.cancel \ No newline at end of file +hdbcli.dbapi.AsyncConnection.cancel From 369e9adc6281682b70ac6e477c16cd1d47be698d Mon Sep 17 00:00:00 2001 From: Kai Harder Date: Tue, 14 Jul 2026 11:18:02 +0000 Subject: [PATCH 5/5] Fix --- stubs/hdbcli/hdbcli/dbapi.pyi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stubs/hdbcli/hdbcli/dbapi.pyi b/stubs/hdbcli/hdbcli/dbapi.pyi index a0370ffa861d..4acfa34cdcfd 100644 --- a/stubs/hdbcli/hdbcli/dbapi.pyi +++ b/stubs/hdbcli/hdbcli/dbapi.pyi @@ -84,7 +84,7 @@ class Cursor: def haswarning(self) -> bool: ... def clearwarning(self) -> None: ... def has_result_set(self) -> bool: ... - def nextset(self, *args, **kwargs) -> None: ... + def nextset(self) -> None: ... def parameter_description(self) -> tuple[str, ...]: ... @overload