Skip to content

Commit 236713a

Browse files
committed
added stubs and mypy
1 parent e5f55d9 commit 236713a

File tree

15 files changed

+2156
-1720
lines changed

15 files changed

+2156
-1720
lines changed

_duckdb-stubs/__init__.pyi

Lines changed: 1420 additions & 0 deletions
Large diffs are not rendered by default.

_duckdb-stubs/functional.pyi

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
import typing as pytyping
2+
3+
__all__: list[str] = ["ARROW", "DEFAULT", "NATIVE", "SPECIAL", "FunctionNullHandling", "PythonUDFType"]
4+
5+
class FunctionNullHandling:
6+
DEFAULT: pytyping.ClassVar[FunctionNullHandling] # value = <FunctionNullHandling.DEFAULT: 0>
7+
SPECIAL: pytyping.ClassVar[FunctionNullHandling] # value = <FunctionNullHandling.SPECIAL: 1>
8+
__members__: pytyping.ClassVar[
9+
dict[str, FunctionNullHandling]
10+
] # value = {'DEFAULT': <FunctionNullHandling.DEFAULT: 0>, 'SPECIAL': <FunctionNullHandling.SPECIAL: 1>}
11+
def __eq__(self, other: object) -> bool: ...
12+
def __getstate__(self) -> int: ...
13+
def __hash__(self) -> int: ...
14+
def __index__(self) -> int: ...
15+
def __init__(self, value: pytyping.SupportsInt) -> None: ...
16+
def __int__(self) -> int: ...
17+
def __ne__(self, other: object) -> bool: ...
18+
def __setstate__(self, state: pytyping.SupportsInt) -> None: ...
19+
@property
20+
def name(self) -> str: ...
21+
@property
22+
def value(self) -> int: ...
23+
24+
class PythonUDFType:
25+
ARROW: pytyping.ClassVar[PythonUDFType] # value = <PythonUDFType.ARROW: 1>
26+
NATIVE: pytyping.ClassVar[PythonUDFType] # value = <PythonUDFType.NATIVE: 0>
27+
__members__: pytyping.ClassVar[
28+
dict[str, PythonUDFType]
29+
] # value = {'NATIVE': <PythonUDFType.NATIVE: 0>, 'ARROW': <PythonUDFType.ARROW: 1>}
30+
def __eq__(self, other: object) -> bool: ...
31+
def __getstate__(self) -> int: ...
32+
def __hash__(self) -> int: ...
33+
def __index__(self) -> int: ...
34+
def __init__(self, value: pytyping.SupportsInt) -> None: ...
35+
def __int__(self) -> int: ...
36+
def __ne__(self, other: object) -> bool: ...
37+
def __setstate__(self, state: pytyping.SupportsInt) -> None: ...
38+
@property
39+
def name(self) -> str: ...
40+
@property
41+
def value(self) -> int: ...
42+
43+
ARROW: PythonUDFType # value = <PythonUDFType.ARROW: 1>
44+
DEFAULT: FunctionNullHandling # value = <FunctionNullHandling.DEFAULT: 0>
45+
NATIVE: PythonUDFType # value = <PythonUDFType.NATIVE: 0>
46+
SPECIAL: FunctionNullHandling # value = <FunctionNullHandling.SPECIAL: 1>

_duckdb-stubs/typing.pyi

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
import typing as pytyping
2+
3+
__all__: list[str] = [
4+
"BIGINT",
5+
"BIT",
6+
"BLOB",
7+
"BOOLEAN",
8+
"DATE",
9+
"DOUBLE",
10+
"FLOAT",
11+
"HUGEINT",
12+
"INTEGER",
13+
"INTERVAL",
14+
"SMALLINT",
15+
"SQLNULL",
16+
"TIME",
17+
"TIMESTAMP",
18+
"TIMESTAMP_MS",
19+
"TIMESTAMP_NS",
20+
"TIMESTAMP_S",
21+
"TIMESTAMP_TZ",
22+
"TIME_TZ",
23+
"TINYINT",
24+
"UBIGINT",
25+
"UHUGEINT",
26+
"UINTEGER",
27+
"USMALLINT",
28+
"UTINYINT",
29+
"UUID",
30+
"VARCHAR",
31+
"DuckDBPyType",
32+
]
33+
34+
class DuckDBPyType:
35+
@pytyping.overload
36+
def __eq__(self, other: DuckDBPyType) -> bool: ...
37+
def __eq__(self, other: str) -> bool: ...
38+
def __getattr__(self, name: str) -> DuckDBPyType: ...
39+
def __getitem__(self, name: str) -> DuckDBPyType: ...
40+
def __hash__(self) -> int: ...
41+
@pytyping.overload
42+
def __init__(self, type_str: str, connection: ...) -> None: ...
43+
@pytyping.overload
44+
def __init__(self, arg0: ...) -> None: ...
45+
@pytyping.overload
46+
def __init__(self, arg0: ...) -> None: ...
47+
def __init__(self, obj: pytyping.Any) -> None: ...
48+
@property
49+
def children(self) -> list: ...
50+
@property
51+
def id(self) -> str: ...
52+
53+
BIGINT: DuckDBPyType # value = BIGINT
54+
BIT: DuckDBPyType # value = BIT
55+
BLOB: DuckDBPyType # value = BLOB
56+
BOOLEAN: DuckDBPyType # value = BOOLEAN
57+
DATE: DuckDBPyType # value = DATE
58+
DOUBLE: DuckDBPyType # value = DOUBLE
59+
FLOAT: DuckDBPyType # value = FLOAT
60+
HUGEINT: DuckDBPyType # value = HUGEINT
61+
INTEGER: DuckDBPyType # value = INTEGER
62+
INTERVAL: DuckDBPyType # value = INTERVAL
63+
SMALLINT: DuckDBPyType # value = SMALLINT
64+
SQLNULL: DuckDBPyType # value = "NULL"
65+
TIME: DuckDBPyType # value = TIME
66+
TIMESTAMP: DuckDBPyType # value = TIMESTAMP
67+
TIMESTAMP_MS: DuckDBPyType # value = TIMESTAMP_MS
68+
TIMESTAMP_NS: DuckDBPyType # value = TIMESTAMP_NS
69+
TIMESTAMP_S: DuckDBPyType # value = TIMESTAMP_S
70+
TIMESTAMP_TZ: DuckDBPyType # value = TIMESTAMP WITH TIME ZONE
71+
TIME_TZ: DuckDBPyType # value = TIME WITH TIME ZONE
72+
TINYINT: DuckDBPyType # value = TINYINT
73+
UBIGINT: DuckDBPyType # value = UBIGINT
74+
UHUGEINT: DuckDBPyType # value = UHUGEINT
75+
UINTEGER: DuckDBPyType # value = UINTEGER
76+
USMALLINT: DuckDBPyType # value = USMALLINT
77+
UTINYINT: DuckDBPyType # value = UTINYINT
78+
UUID: DuckDBPyType # value = UUID
79+
VARCHAR: DuckDBPyType # value = VARCHAR

0 commit comments

Comments
 (0)