From 27caa8f2210474f84442f5b561acc43376911914 Mon Sep 17 00:00:00 2001 From: Nikita Sobolev Date: Thu, 3 Nov 2022 17:38:51 +0300 Subject: [PATCH] Mark `hdbcli` as complete (#8904) --- stubs/hdbcli/@tests/stubtest_allowlist.txt | 2 ++ stubs/hdbcli/METADATA.toml | 3 +++ stubs/hdbcli/hdbcli/__init__.pyi | 2 ++ stubs/hdbcli/hdbcli/dbapi.pyi | 22 +++++++++++++++++++++- 4 files changed, 28 insertions(+), 1 deletion(-) diff --git a/stubs/hdbcli/@tests/stubtest_allowlist.txt b/stubs/hdbcli/@tests/stubtest_allowlist.txt index d73612be9..bb9185155 100644 --- a/stubs/hdbcli/@tests/stubtest_allowlist.txt +++ b/stubs/hdbcli/@tests/stubtest_allowlist.txt @@ -1,4 +1,6 @@ +# Are set to `None` by default, initialized later: hdbcli.dbapi.Error.errorcode hdbcli.dbapi.Error.errortext hdbcli.dbapi.Warning.errorcode hdbcli.dbapi.Warning.errortext +hdbcli.dbapi.ExecuteManyErrorEntry.rownumber diff --git a/stubs/hdbcli/METADATA.toml b/stubs/hdbcli/METADATA.toml index 50c5605f2..60f63b342 100644 --- a/stubs/hdbcli/METADATA.toml +++ b/stubs/hdbcli/METADATA.toml @@ -1 +1,4 @@ version = "2.14.*" + +[tool.stubtest] +ignore_missing_stub = false diff --git a/stubs/hdbcli/hdbcli/__init__.pyi b/stubs/hdbcli/hdbcli/__init__.pyi index bda5b5a7f..af0d55ba5 100644 --- a/stubs/hdbcli/hdbcli/__init__.pyi +++ b/stubs/hdbcli/hdbcli/__init__.pyi @@ -1 +1,3 @@ +from . import dbapi as dbapi + __version__: str diff --git a/stubs/hdbcli/hdbcli/dbapi.pyi b/stubs/hdbcli/hdbcli/dbapi.pyi index 3ec97b6fe..51216e873 100644 --- a/stubs/hdbcli/hdbcli/dbapi.pyi +++ b/stubs/hdbcli/hdbcli/dbapi.pyi @@ -1,7 +1,8 @@ import decimal -from _typeshed import ReadableBuffer +from _typeshed import Incomplete, ReadableBuffer from collections.abc import Sequence from datetime import date, datetime, time +from types import TracebackType from typing import Any, overload from typing_extensions import Literal, TypeAlias @@ -33,6 +34,7 @@ class Connection: def getaddress(self) -> str: ... def getautocommit(self) -> bool: ... def getclientinfo(self, key: str = ...) -> str | dict[str, str]: ... + def getproperty(self, *args: Incomplete, **kwargs: Incomplete) -> Incomplete: ... def isconnected(self) -> bool: ... def rollback(self) -> None: ... def setautocommit(self, auto: bool = ...) -> None: ... @@ -53,7 +55,11 @@ class Cursor: statementhash: str | None connection: Connection arraysize: int + refreshts: Incomplete + maxage: int def __init__(self, *args: Any, **kwargs: Any) -> None: ... + def __enter__(self) -> Incomplete: ... + def __exit__(self, typ: type[BaseException] | None, val: BaseException | None, tb: TracebackType | None) -> None: ... def callproc(self, procname: str, parameters: tuple[Any, ...] = ..., overview: bool = ...) -> tuple[Any, ...]: ... def close(self) -> None: ... def description_ext(self) -> Sequence[tuple[Any, ...]]: ... @@ -64,21 +70,29 @@ class Cursor: def fetchone(self, uselob: bool = ...) -> ResultRow | None: ... def fetchall(self) -> list[ResultRow]: ... def fetchmany(self, size: int | None = ...) -> list[ResultRow]: ... + def getrowsaffectedcounts(self) -> tuple[Any, ...]: ... + def getpacketsize(self) -> int: ... def get_resultset_holdability(self) -> int: ... def getwarning(self) -> Warning | None: ... def haswarning(self) -> bool: ... + def clearwarning(self) -> None: ... + def has_result_set(self) -> bool: ... def nextset(self) -> None: ... def parameter_description(self) -> tuple[str, ...]: ... @overload def prepare(self, operation: str, newcursor: Literal[True]) -> Cursor: ... @overload def prepare(self, operation: str, newcursor: Literal[False]) -> Any: ... + def print_message(self, *args: Incomplete, **kwargs: Incomplete) -> Incomplete: ... + def parsenamedquery(self, *args: Incomplete, **kwargs: Incomplete) -> Incomplete: ... def scroll(self, value: int, mode: Literal["absolute", "relative"] = ...) -> None: ... def server_cpu_time(self) -> int: ... def server_memory_usage(self) -> int: ... def server_processing_time(self) -> int: ... def setinputsizes(self, *args: Any, **kwargs: Any) -> None: ... def setfetchsize(self, value: int) -> None: ... + def setquerytimeout(self, value: int) -> None: ... + def setpacketsize(self, value: int) -> None: ... def set_resultset_holdability(self, holdability: int) -> None: ... def setoutputsize(self, *args: Any, **kwargs: Any) -> None: ... @@ -99,6 +113,12 @@ class InternalError(DatabaseError): ... class DataError(DatabaseError): ... class NotSupportedError(DatabaseError): ... +class ExecuteManyError(Error): + errors: Incomplete + +class ExecuteManyErrorEntry(Error): + rownumber: int + def Date(year: int, month: int, day: int) -> date: ... def Time(hour: int, minute: int, second: int, millisecond: int = ...) -> time: ... def Timestamp(year: int, month: int, day: int, hour: int, minute: int, second: int, millisecond: int = ...) -> datetime: ...