duckdb 1.4.0.dev465__cp312-cp312-win_amd64.whl → 1.5.0.dev53__cp312-cp312-win_amd64.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of duckdb might be problematic. Click here for more details.
- _duckdb-stubs/__init__.pyi +1443 -0
- _duckdb-stubs/_func.pyi +46 -0
- _duckdb-stubs/_sqltypes.pyi +75 -0
- duckdb/duckdb.cp312-win_amd64.pyd → _duckdb.cp312-win_amd64.pyd +0 -0
- adbc_driver_duckdb/__init__.py +11 -8
- adbc_driver_duckdb/dbapi.py +2 -3
- duckdb/__init__.py +343 -388
- duckdb/_dbapi_type_object.py +231 -0
- duckdb/_version.py +22 -0
- duckdb/bytes_io_wrapper.py +12 -9
- duckdb/experimental/__init__.py +2 -1
- duckdb/experimental/spark/__init__.py +3 -4
- duckdb/experimental/spark/_globals.py +8 -8
- duckdb/experimental/spark/_typing.py +7 -9
- duckdb/experimental/spark/conf.py +16 -15
- duckdb/experimental/spark/context.py +60 -44
- duckdb/experimental/spark/errors/__init__.py +33 -35
- duckdb/experimental/spark/errors/error_classes.py +1 -1
- duckdb/experimental/spark/errors/exceptions/__init__.py +1 -1
- duckdb/experimental/spark/errors/exceptions/base.py +39 -88
- duckdb/experimental/spark/errors/utils.py +11 -16
- duckdb/experimental/spark/exception.py +9 -6
- duckdb/experimental/spark/sql/__init__.py +5 -5
- duckdb/experimental/spark/sql/_typing.py +8 -15
- duckdb/experimental/spark/sql/catalog.py +21 -20
- duckdb/experimental/spark/sql/column.py +48 -55
- duckdb/experimental/spark/sql/conf.py +9 -8
- duckdb/experimental/spark/sql/dataframe.py +213 -231
- duckdb/experimental/spark/sql/functions.py +1317 -1220
- duckdb/experimental/spark/sql/group.py +56 -52
- duckdb/experimental/spark/sql/readwriter.py +80 -94
- duckdb/experimental/spark/sql/session.py +64 -59
- duckdb/experimental/spark/sql/streaming.py +9 -10
- duckdb/experimental/spark/sql/type_utils.py +67 -65
- duckdb/experimental/spark/sql/types.py +309 -345
- duckdb/experimental/spark/sql/udf.py +6 -6
- duckdb/filesystem.py +26 -16
- duckdb/func/__init__.py +3 -0
- duckdb/functional/__init__.py +12 -16
- duckdb/polars_io.py +284 -0
- duckdb/query_graph/__main__.py +91 -96
- duckdb/sqltypes/__init__.py +63 -0
- duckdb/typing/__init__.py +18 -8
- duckdb/udf.py +10 -5
- duckdb/value/__init__.py +1 -0
- duckdb/value/{constant.py → constant/__init__.py} +62 -60
- duckdb-1.5.0.dev53.dist-info/METADATA +87 -0
- duckdb-1.5.0.dev53.dist-info/RECORD +52 -0
- {duckdb-1.4.0.dev465.dist-info → duckdb-1.5.0.dev53.dist-info}/WHEEL +1 -1
- duckdb-1.5.0.dev53.dist-info/licenses/LICENSE +7 -0
- duckdb-1.4.0.dev465.dist-info/METADATA +0 -47
- duckdb-1.4.0.dev465.dist-info/RECORD +0 -47
- duckdb-1.4.0.dev465.dist-info/top_level.txt +0 -3
- duckdb-stubs/__init__.pyi +0 -711
- duckdb-stubs/functional/__init__.pyi +0 -33
- duckdb-stubs/typing/__init__.pyi +0 -37
- duckdb-stubs/value/constant/__init__.pyi +0 -116
- /duckdb-stubs/value/__init__.pyi → /duckdb/py.typed +0 -0
_duckdb-stubs/_func.pyi
ADDED
|
@@ -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>
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import duckdb
|
|
2
|
+
import typing as pytyping
|
|
3
|
+
|
|
4
|
+
__all__: list[str] = [
|
|
5
|
+
"BIGINT",
|
|
6
|
+
"BIT",
|
|
7
|
+
"BLOB",
|
|
8
|
+
"BOOLEAN",
|
|
9
|
+
"DATE",
|
|
10
|
+
"DOUBLE",
|
|
11
|
+
"FLOAT",
|
|
12
|
+
"HUGEINT",
|
|
13
|
+
"INTEGER",
|
|
14
|
+
"INTERVAL",
|
|
15
|
+
"SMALLINT",
|
|
16
|
+
"SQLNULL",
|
|
17
|
+
"TIME",
|
|
18
|
+
"TIMESTAMP",
|
|
19
|
+
"TIMESTAMP_MS",
|
|
20
|
+
"TIMESTAMP_NS",
|
|
21
|
+
"TIMESTAMP_S",
|
|
22
|
+
"TIMESTAMP_TZ",
|
|
23
|
+
"TIME_TZ",
|
|
24
|
+
"TINYINT",
|
|
25
|
+
"UBIGINT",
|
|
26
|
+
"UHUGEINT",
|
|
27
|
+
"UINTEGER",
|
|
28
|
+
"USMALLINT",
|
|
29
|
+
"UTINYINT",
|
|
30
|
+
"UUID",
|
|
31
|
+
"VARCHAR",
|
|
32
|
+
"DuckDBPyType",
|
|
33
|
+
]
|
|
34
|
+
|
|
35
|
+
class DuckDBPyType:
|
|
36
|
+
def __eq__(self, other: object) -> bool: ...
|
|
37
|
+
def __getattr__(self, name: str) -> DuckDBPyType: ...
|
|
38
|
+
def __getitem__(self, name: str) -> DuckDBPyType: ...
|
|
39
|
+
def __hash__(self) -> int: ...
|
|
40
|
+
@pytyping.overload
|
|
41
|
+
def __init__(self, type_str: str, connection: duckdb.DuckDBPyConnection) -> None: ...
|
|
42
|
+
@pytyping.overload
|
|
43
|
+
def __init__(self, obj: object) -> None: ...
|
|
44
|
+
@property
|
|
45
|
+
def children(self) -> list[tuple[str, object]]: ...
|
|
46
|
+
@property
|
|
47
|
+
def id(self) -> str: ...
|
|
48
|
+
|
|
49
|
+
BIGINT: DuckDBPyType # value = BIGINT
|
|
50
|
+
BIT: DuckDBPyType # value = BIT
|
|
51
|
+
BLOB: DuckDBPyType # value = BLOB
|
|
52
|
+
BOOLEAN: DuckDBPyType # value = BOOLEAN
|
|
53
|
+
DATE: DuckDBPyType # value = DATE
|
|
54
|
+
DOUBLE: DuckDBPyType # value = DOUBLE
|
|
55
|
+
FLOAT: DuckDBPyType # value = FLOAT
|
|
56
|
+
HUGEINT: DuckDBPyType # value = HUGEINT
|
|
57
|
+
INTEGER: DuckDBPyType # value = INTEGER
|
|
58
|
+
INTERVAL: DuckDBPyType # value = INTERVAL
|
|
59
|
+
SMALLINT: DuckDBPyType # value = SMALLINT
|
|
60
|
+
SQLNULL: DuckDBPyType # value = "NULL"
|
|
61
|
+
TIME: DuckDBPyType # value = TIME
|
|
62
|
+
TIMESTAMP: DuckDBPyType # value = TIMESTAMP
|
|
63
|
+
TIMESTAMP_MS: DuckDBPyType # value = TIMESTAMP_MS
|
|
64
|
+
TIMESTAMP_NS: DuckDBPyType # value = TIMESTAMP_NS
|
|
65
|
+
TIMESTAMP_S: DuckDBPyType # value = TIMESTAMP_S
|
|
66
|
+
TIMESTAMP_TZ: DuckDBPyType # value = TIMESTAMP WITH TIME ZONE
|
|
67
|
+
TIME_TZ: DuckDBPyType # value = TIME WITH TIME ZONE
|
|
68
|
+
TINYINT: DuckDBPyType # value = TINYINT
|
|
69
|
+
UBIGINT: DuckDBPyType # value = UBIGINT
|
|
70
|
+
UHUGEINT: DuckDBPyType # value = UHUGEINT
|
|
71
|
+
UINTEGER: DuckDBPyType # value = UINTEGER
|
|
72
|
+
USMALLINT: DuckDBPyType # value = USMALLINT
|
|
73
|
+
UTINYINT: DuckDBPyType # value = UTINYINT
|
|
74
|
+
UUID: DuckDBPyType # value = UUID
|
|
75
|
+
VARCHAR: DuckDBPyType # value = VARCHAR
|
|
Binary file
|
adbc_driver_duckdb/__init__.py
CHANGED
|
@@ -19,12 +19,11 @@
|
|
|
19
19
|
|
|
20
20
|
import enum
|
|
21
21
|
import functools
|
|
22
|
+
import importlib
|
|
22
23
|
import typing
|
|
23
24
|
|
|
24
25
|
import adbc_driver_manager
|
|
25
26
|
|
|
26
|
-
__all__ = ["StatementOptions", "connect"]
|
|
27
|
-
|
|
28
27
|
|
|
29
28
|
class StatementOptions(enum.Enum):
|
|
30
29
|
"""Statement options specific to the DuckDB driver."""
|
|
@@ -36,12 +35,16 @@ class StatementOptions(enum.Enum):
|
|
|
36
35
|
def connect(path: typing.Optional[str] = None) -> adbc_driver_manager.AdbcDatabase:
|
|
37
36
|
"""Create a low level ADBC connection to DuckDB."""
|
|
38
37
|
if path is None:
|
|
39
|
-
return adbc_driver_manager.AdbcDatabase(driver=
|
|
40
|
-
return adbc_driver_manager.AdbcDatabase(driver=
|
|
38
|
+
return adbc_driver_manager.AdbcDatabase(driver=driver_path(), entrypoint="duckdb_adbc_init")
|
|
39
|
+
return adbc_driver_manager.AdbcDatabase(driver=driver_path(), entrypoint="duckdb_adbc_init", path=path)
|
|
41
40
|
|
|
42
41
|
|
|
43
42
|
@functools.cache
|
|
44
|
-
def
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
43
|
+
def driver_path() -> str:
|
|
44
|
+
"""Get the path to the DuckDB ADBC driver."""
|
|
45
|
+
duckdb_module_spec = importlib.util.find_spec("_duckdb")
|
|
46
|
+
if duckdb_module_spec is None:
|
|
47
|
+
msg = "Could not find duckdb shared library. Did you pip install duckdb?"
|
|
48
|
+
raise ImportError(msg)
|
|
49
|
+
print(f"Found duckdb shared library at {duckdb_module_spec.origin}")
|
|
50
|
+
return duckdb_module_spec.origin
|
adbc_driver_duckdb/dbapi.py
CHANGED
|
@@ -15,14 +15,13 @@
|
|
|
15
15
|
# specific language governing permissions and limitations
|
|
16
16
|
# under the License.
|
|
17
17
|
|
|
18
|
-
"""
|
|
19
|
-
DBAPI 2.0-compatible facade for the ADBC DuckDB driver.
|
|
20
|
-
"""
|
|
18
|
+
"""DBAPI 2.0-compatible facade for the ADBC DuckDB driver."""
|
|
21
19
|
|
|
22
20
|
import typing
|
|
23
21
|
|
|
24
22
|
import adbc_driver_manager
|
|
25
23
|
import adbc_driver_manager.dbapi
|
|
24
|
+
|
|
26
25
|
import adbc_driver_duckdb
|
|
27
26
|
|
|
28
27
|
__all__ = [
|