Skip to content

Commit 8a94680

Browse files
committed
use CppEnum and remove the protocol functions from subclasses
1 parent 399ede4 commit 8a94680

File tree

1 file changed

+3
-26
lines changed

1 file changed

+3
-26
lines changed

_duckdb-stubs/_func.pyi

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

34
__all__: list[str] = ["ARROW", "DEFAULT", "NATIVE", "SPECIAL", "FunctionNullHandling", "PythonUDFType"]
45

5-
class FunctionNullHandling:
6+
class FunctionNullHandling(CppEnum):
67
DEFAULT: ClassVar[FunctionNullHandling] # value = <FunctionNullHandling.DEFAULT: 0>
78
SPECIAL: ClassVar[FunctionNullHandling] # value = <FunctionNullHandling.SPECIAL: 1>
89
__members__: ClassVar[
910
dict[str, FunctionNullHandling]
1011
] # 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: ...
2312

2413
class PythonUDFType(CppEnum):
2514
ARROW: ClassVar[PythonUDFType] # value = <PythonUDFType.ARROW: 1>
2615
NATIVE: ClassVar[PythonUDFType] # value = <PythonUDFType.NATIVE: 0>
2716
__members__: ClassVar[
2817
dict[str, PythonUDFType]
2918
] # 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: ...
4219

4320
ARROW: PythonUDFType # value = <PythonUDFType.ARROW: 1>
4421
DEFAULT: FunctionNullHandling # value = <FunctionNullHandling.DEFAULT: 0>

0 commit comments

Comments
 (0)