Skip to content

Commit a8d3546

Browse files
committed
last fixes
1 parent 4513935 commit a8d3546

2 files changed

Lines changed: 29 additions & 6 deletions

File tree

_duckdb-stubs/_func.pyi

Lines changed: 26 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,44 @@
1-
from typing import ClassVar
2-
from ._enums import CppEnum
1+
from typing import ClassVar, SupportsInt
32

43
__all__: list[str] = ["ARROW", "DEFAULT", "NATIVE", "SPECIAL", "FunctionNullHandling", "PythonUDFType"]
54

6-
class FunctionNullHandling(CppEnum):
5+
class FunctionNullHandling:
76
DEFAULT: ClassVar[FunctionNullHandling] # value = <FunctionNullHandling.DEFAULT: 0>
87
SPECIAL: ClassVar[FunctionNullHandling] # value = <FunctionNullHandling.SPECIAL: 1>
98
__members__: ClassVar[
109
dict[str, FunctionNullHandling]
1110
] # 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: SupportsInt) -> None: ...
16+
def __int__(self) -> int: ...
17+
def __ne__(self, other: object) -> bool: ...
18+
def __setstate__(self, state: SupportsInt) -> None: ...
19+
@property
20+
def name(self) -> str: ...
21+
@property
22+
def value(self) -> int: ...
1223

1324
class PythonUDFType:
1425
ARROW: ClassVar[PythonUDFType] # value = <PythonUDFType.ARROW: 1>
1526
NATIVE: ClassVar[PythonUDFType] # value = <PythonUDFType.NATIVE: 0>
1627
__members__: ClassVar[
1728
dict[str, PythonUDFType]
1829
] # 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: SupportsInt) -> None: ...
35+
def __int__(self) -> int: ...
36+
def __ne__(self, other: object) -> bool: ...
37+
def __setstate__(self, state: SupportsInt) -> None: ...
38+
@property
39+
def name(self) -> str: ...
40+
@property
41+
def value(self) -> int: ...
1942

2043
ARROW: PythonUDFType # value = <PythonUDFType.ARROW: 1>
2144
DEFAULT: FunctionNullHandling # value = <FunctionNullHandling.DEFAULT: 0>

_duckdb-stubs/_typing.pyi

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ NonNestedLiteral: TypeAlias = ScalarLiteral | TemporalLiteral | UUID | Decimal |
6969
# NOTE:
7070
# Using `Sequence` and `Mapping` instead of `list | tuple` and `dict` would make the covariance of the element types work.
7171
# Thus, this would allow to avoid the use of `Any` for them.
72-
# However, this would also be incorrect at runtime, since only the 3 aformentioned containers types are accepted.
72+
# However, this would also be incorrect at runtime, since only the 3 aforementioned containers types are accepted.
7373
NestedLiteral: TypeAlias = list[Any] | tuple[Any, ...] | dict[Any, Any] | NPArrayLike[Any, Any]
7474
"""Containers types that can be converted to a nested `ConstantExpression` (e.g. to `ARRAY` or `STRUCT`).
7575
@@ -148,7 +148,7 @@ Note:
148148
A `StrEnum` will be handled the same way as a `str`."""
149149

150150
# NOTE:
151-
# the `dict` and `list` types are `Any` due to the same limitation mentionned in `NestedLiteral`.
151+
# the `dict` and `list` types are `Any` due to the same limitation mentioned in `NestedLiteral`.
152152
IntoPyType: TypeAlias = (
153153
DuckDBPyType
154154
| StrIntoPyType
@@ -193,7 +193,7 @@ ParquetFieldsOptions: TypeAlias = _Auto | ParquetFieldIdsType
193193
CsvEncoding: TypeAlias = Literal["utf-8", "utf-16", "latin-1"] | str
194194
"""Encoding options.
195195
196-
All availables options not in the literal values can be seen here:
196+
All available options not in the literal values can be seen here:
197197
https://duckdb.org/docs/stable/core_extensions/encodings
198198
"""
199199
JsonFormat: TypeAlias = _Auto | Literal["unstructured", "newline_delimited", "array"]

0 commit comments

Comments
 (0)