duckdb 1.4.1.dev125__cp310-cp310-win_amd64.whl → 1.5.0.dev44__cp310-cp310-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.cp310-win_amd64.pyd +0 -0
- duckdb/__init__.py +374 -373
- duckdb/__init__.pyi +180 -604
- duckdb/bytes_io_wrapper.py +7 -6
- duckdb/experimental/__init__.py +1 -2
- duckdb/experimental/spark/__init__.py +4 -3
- duckdb/experimental/spark/_globals.py +8 -8
- duckdb/experimental/spark/_typing.py +9 -7
- duckdb/experimental/spark/conf.py +15 -16
- duckdb/experimental/spark/context.py +44 -60
- duckdb/experimental/spark/errors/__init__.py +35 -33
- 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 +88 -39
- duckdb/experimental/spark/errors/utils.py +16 -11
- duckdb/experimental/spark/exception.py +6 -9
- duckdb/experimental/spark/sql/__init__.py +5 -5
- duckdb/experimental/spark/sql/_typing.py +15 -8
- duckdb/experimental/spark/sql/catalog.py +20 -21
- duckdb/experimental/spark/sql/column.py +54 -47
- duckdb/experimental/spark/sql/conf.py +8 -9
- duckdb/experimental/spark/sql/dataframe.py +233 -185
- duckdb/experimental/spark/sql/functions.py +1248 -1222
- duckdb/experimental/spark/sql/group.py +52 -56
- duckdb/experimental/spark/sql/readwriter.py +94 -80
- duckdb/experimental/spark/sql/session.py +59 -64
- duckdb/experimental/spark/sql/streaming.py +10 -9
- duckdb/experimental/spark/sql/type_utils.py +64 -66
- duckdb/experimental/spark/sql/types.py +344 -308
- duckdb/experimental/spark/sql/udf.py +6 -6
- duckdb/filesystem.py +8 -13
- duckdb/functional/__init__.py +16 -2
- duckdb/polars_io.py +57 -66
- duckdb/query_graph/__main__.py +96 -91
- duckdb/typing/__init__.py +8 -8
- duckdb/typing/__init__.pyi +2 -4
- duckdb/udf.py +5 -10
- duckdb/value/__init__.py +0 -1
- duckdb/value/constant/__init__.py +59 -61
- duckdb/value/constant/__init__.pyi +4 -3
- duckdb-1.5.0.dev44.dist-info/METADATA +80 -0
- duckdb-1.5.0.dev44.dist-info/RECORD +47 -0
- adbc_driver_duckdb/__init__.py +0 -50
- adbc_driver_duckdb/dbapi.py +0 -115
- duckdb-1.4.1.dev125.dist-info/METADATA +0 -326
- duckdb-1.4.1.dev125.dist-info/RECORD +0 -49
- {duckdb-1.4.1.dev125.dist-info → duckdb-1.5.0.dev44.dist-info}/WHEEL +0 -0
- {duckdb-1.4.1.dev125.dist-info → duckdb-1.5.0.dev44.dist-info}/licenses/LICENSE +0 -0
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
from typing import
|
|
3
|
-
|
|
1
|
+
from typing import Any, Dict
|
|
2
|
+
from duckdb.typing import DuckDBPyType
|
|
4
3
|
from duckdb.typing import (
|
|
5
4
|
BIGINT,
|
|
6
5
|
BIT,
|
|
@@ -10,31 +9,30 @@ from duckdb.typing import (
|
|
|
10
9
|
DOUBLE,
|
|
11
10
|
FLOAT,
|
|
12
11
|
HUGEINT,
|
|
12
|
+
UHUGEINT,
|
|
13
13
|
INTEGER,
|
|
14
14
|
INTERVAL,
|
|
15
15
|
SMALLINT,
|
|
16
16
|
SQLNULL,
|
|
17
17
|
TIME,
|
|
18
|
-
TIME_TZ,
|
|
19
18
|
TIMESTAMP,
|
|
20
19
|
TIMESTAMP_MS,
|
|
21
20
|
TIMESTAMP_NS,
|
|
22
21
|
TIMESTAMP_S,
|
|
23
22
|
TIMESTAMP_TZ,
|
|
23
|
+
TIME_TZ,
|
|
24
24
|
TINYINT,
|
|
25
25
|
UBIGINT,
|
|
26
|
-
UHUGEINT,
|
|
27
26
|
UINTEGER,
|
|
28
27
|
USMALLINT,
|
|
29
28
|
UTINYINT,
|
|
30
29
|
UUID,
|
|
31
30
|
VARCHAR,
|
|
32
|
-
DuckDBPyType,
|
|
33
31
|
)
|
|
34
32
|
|
|
35
33
|
|
|
36
34
|
class Value:
|
|
37
|
-
def __init__(self, object: Any, type: DuckDBPyType)
|
|
35
|
+
def __init__(self, object: Any, type: DuckDBPyType):
|
|
38
36
|
self.object = object
|
|
39
37
|
self.type = type
|
|
40
38
|
|
|
@@ -46,12 +44,12 @@ class Value:
|
|
|
46
44
|
|
|
47
45
|
|
|
48
46
|
class NullValue(Value):
|
|
49
|
-
def __init__(self)
|
|
47
|
+
def __init__(self):
|
|
50
48
|
super().__init__(None, SQLNULL)
|
|
51
49
|
|
|
52
50
|
|
|
53
51
|
class BooleanValue(Value):
|
|
54
|
-
def __init__(self, object: Any)
|
|
52
|
+
def __init__(self, object: Any):
|
|
55
53
|
super().__init__(object, BOOLEAN)
|
|
56
54
|
|
|
57
55
|
|
|
@@ -59,22 +57,22 @@ class BooleanValue(Value):
|
|
|
59
57
|
|
|
60
58
|
|
|
61
59
|
class UnsignedBinaryValue(Value):
|
|
62
|
-
def __init__(self, object: Any)
|
|
60
|
+
def __init__(self, object: Any):
|
|
63
61
|
super().__init__(object, UTINYINT)
|
|
64
62
|
|
|
65
63
|
|
|
66
64
|
class UnsignedShortValue(Value):
|
|
67
|
-
def __init__(self, object: Any)
|
|
65
|
+
def __init__(self, object: Any):
|
|
68
66
|
super().__init__(object, USMALLINT)
|
|
69
67
|
|
|
70
68
|
|
|
71
69
|
class UnsignedIntegerValue(Value):
|
|
72
|
-
def __init__(self, object: Any)
|
|
70
|
+
def __init__(self, object: Any):
|
|
73
71
|
super().__init__(object, UINTEGER)
|
|
74
72
|
|
|
75
73
|
|
|
76
74
|
class UnsignedLongValue(Value):
|
|
77
|
-
def __init__(self, object: Any)
|
|
75
|
+
def __init__(self, object: Any):
|
|
78
76
|
super().__init__(object, UBIGINT)
|
|
79
77
|
|
|
80
78
|
|
|
@@ -82,32 +80,32 @@ class UnsignedLongValue(Value):
|
|
|
82
80
|
|
|
83
81
|
|
|
84
82
|
class BinaryValue(Value):
|
|
85
|
-
def __init__(self, object: Any)
|
|
83
|
+
def __init__(self, object: Any):
|
|
86
84
|
super().__init__(object, TINYINT)
|
|
87
85
|
|
|
88
86
|
|
|
89
87
|
class ShortValue(Value):
|
|
90
|
-
def __init__(self, object: Any)
|
|
88
|
+
def __init__(self, object: Any):
|
|
91
89
|
super().__init__(object, SMALLINT)
|
|
92
90
|
|
|
93
91
|
|
|
94
92
|
class IntegerValue(Value):
|
|
95
|
-
def __init__(self, object: Any)
|
|
93
|
+
def __init__(self, object: Any):
|
|
96
94
|
super().__init__(object, INTEGER)
|
|
97
95
|
|
|
98
96
|
|
|
99
97
|
class LongValue(Value):
|
|
100
|
-
def __init__(self, object: Any)
|
|
98
|
+
def __init__(self, object: Any):
|
|
101
99
|
super().__init__(object, BIGINT)
|
|
102
100
|
|
|
103
101
|
|
|
104
102
|
class HugeIntegerValue(Value):
|
|
105
|
-
def __init__(self, object: Any)
|
|
103
|
+
def __init__(self, object: Any):
|
|
106
104
|
super().__init__(object, HUGEINT)
|
|
107
105
|
|
|
108
106
|
|
|
109
107
|
class UnsignedHugeIntegerValue(Value):
|
|
110
|
-
def __init__(self, object: Any)
|
|
108
|
+
def __init__(self, object: Any):
|
|
111
109
|
super().__init__(object, UHUGEINT)
|
|
112
110
|
|
|
113
111
|
|
|
@@ -115,17 +113,17 @@ class UnsignedHugeIntegerValue(Value):
|
|
|
115
113
|
|
|
116
114
|
|
|
117
115
|
class FloatValue(Value):
|
|
118
|
-
def __init__(self, object: Any)
|
|
116
|
+
def __init__(self, object: Any):
|
|
119
117
|
super().__init__(object, FLOAT)
|
|
120
118
|
|
|
121
119
|
|
|
122
120
|
class DoubleValue(Value):
|
|
123
|
-
def __init__(self, object: Any)
|
|
121
|
+
def __init__(self, object: Any):
|
|
124
122
|
super().__init__(object, DOUBLE)
|
|
125
123
|
|
|
126
124
|
|
|
127
125
|
class DecimalValue(Value):
|
|
128
|
-
def __init__(self, object: Any, width: int, scale: int)
|
|
126
|
+
def __init__(self, object: Any, width: int, scale: int):
|
|
129
127
|
import duckdb
|
|
130
128
|
|
|
131
129
|
decimal_type = duckdb.decimal_type(width, scale)
|
|
@@ -136,22 +134,22 @@ class DecimalValue(Value):
|
|
|
136
134
|
|
|
137
135
|
|
|
138
136
|
class StringValue(Value):
|
|
139
|
-
def __init__(self, object: Any)
|
|
137
|
+
def __init__(self, object: Any):
|
|
140
138
|
super().__init__(object, VARCHAR)
|
|
141
139
|
|
|
142
140
|
|
|
143
141
|
class UUIDValue(Value):
|
|
144
|
-
def __init__(self, object: Any)
|
|
142
|
+
def __init__(self, object: Any):
|
|
145
143
|
super().__init__(object, UUID)
|
|
146
144
|
|
|
147
145
|
|
|
148
146
|
class BitValue(Value):
|
|
149
|
-
def __init__(self, object: Any)
|
|
147
|
+
def __init__(self, object: Any):
|
|
150
148
|
super().__init__(object, BIT)
|
|
151
149
|
|
|
152
150
|
|
|
153
151
|
class BlobValue(Value):
|
|
154
|
-
def __init__(self, object: Any)
|
|
152
|
+
def __init__(self, object: Any):
|
|
155
153
|
super().__init__(object, BLOB)
|
|
156
154
|
|
|
157
155
|
|
|
@@ -159,52 +157,52 @@ class BlobValue(Value):
|
|
|
159
157
|
|
|
160
158
|
|
|
161
159
|
class DateValue(Value):
|
|
162
|
-
def __init__(self, object: Any)
|
|
160
|
+
def __init__(self, object: Any):
|
|
163
161
|
super().__init__(object, DATE)
|
|
164
162
|
|
|
165
163
|
|
|
166
164
|
class IntervalValue(Value):
|
|
167
|
-
def __init__(self, object: Any)
|
|
165
|
+
def __init__(self, object: Any):
|
|
168
166
|
super().__init__(object, INTERVAL)
|
|
169
167
|
|
|
170
168
|
|
|
171
169
|
class TimestampValue(Value):
|
|
172
|
-
def __init__(self, object: Any)
|
|
170
|
+
def __init__(self, object: Any):
|
|
173
171
|
super().__init__(object, TIMESTAMP)
|
|
174
172
|
|
|
175
173
|
|
|
176
174
|
class TimestampSecondValue(Value):
|
|
177
|
-
def __init__(self, object: Any)
|
|
175
|
+
def __init__(self, object: Any):
|
|
178
176
|
super().__init__(object, TIMESTAMP_S)
|
|
179
177
|
|
|
180
178
|
|
|
181
179
|
class TimestampMilisecondValue(Value):
|
|
182
|
-
def __init__(self, object: Any)
|
|
180
|
+
def __init__(self, object: Any):
|
|
183
181
|
super().__init__(object, TIMESTAMP_MS)
|
|
184
182
|
|
|
185
183
|
|
|
186
184
|
class TimestampNanosecondValue(Value):
|
|
187
|
-
def __init__(self, object: Any)
|
|
185
|
+
def __init__(self, object: Any):
|
|
188
186
|
super().__init__(object, TIMESTAMP_NS)
|
|
189
187
|
|
|
190
188
|
|
|
191
189
|
class TimestampTimeZoneValue(Value):
|
|
192
|
-
def __init__(self, object: Any)
|
|
190
|
+
def __init__(self, object: Any):
|
|
193
191
|
super().__init__(object, TIMESTAMP_TZ)
|
|
194
192
|
|
|
195
193
|
|
|
196
194
|
class TimeValue(Value):
|
|
197
|
-
def __init__(self, object: Any)
|
|
195
|
+
def __init__(self, object: Any):
|
|
198
196
|
super().__init__(object, TIME)
|
|
199
197
|
|
|
200
198
|
|
|
201
199
|
class TimeTimeZoneValue(Value):
|
|
202
|
-
def __init__(self, object: Any)
|
|
200
|
+
def __init__(self, object: Any):
|
|
203
201
|
super().__init__(object, TIME_TZ)
|
|
204
202
|
|
|
205
203
|
|
|
206
204
|
class ListValue(Value):
|
|
207
|
-
def __init__(self, object: Any, child_type: DuckDBPyType)
|
|
205
|
+
def __init__(self, object: Any, child_type: DuckDBPyType):
|
|
208
206
|
import duckdb
|
|
209
207
|
|
|
210
208
|
list_type = duckdb.list_type(child_type)
|
|
@@ -212,7 +210,7 @@ class ListValue(Value):
|
|
|
212
210
|
|
|
213
211
|
|
|
214
212
|
class StructValue(Value):
|
|
215
|
-
def __init__(self, object: Any, children:
|
|
213
|
+
def __init__(self, object: Any, children: Dict[str, DuckDBPyType]):
|
|
216
214
|
import duckdb
|
|
217
215
|
|
|
218
216
|
struct_type = duckdb.struct_type(children)
|
|
@@ -220,7 +218,7 @@ class StructValue(Value):
|
|
|
220
218
|
|
|
221
219
|
|
|
222
220
|
class MapValue(Value):
|
|
223
|
-
def __init__(self, object: Any, key_type: DuckDBPyType, value_type: DuckDBPyType)
|
|
221
|
+
def __init__(self, object: Any, key_type: DuckDBPyType, value_type: DuckDBPyType):
|
|
224
222
|
import duckdb
|
|
225
223
|
|
|
226
224
|
map_type = duckdb.map_type(key_type, value_type)
|
|
@@ -228,43 +226,43 @@ class MapValue(Value):
|
|
|
228
226
|
|
|
229
227
|
|
|
230
228
|
class UnionType(Value):
|
|
231
|
-
def __init__(self, object: Any, members:
|
|
229
|
+
def __init__(self, object: Any, members: Dict[str, DuckDBPyType]):
|
|
232
230
|
import duckdb
|
|
233
231
|
|
|
234
232
|
union_type = duckdb.union_type(members)
|
|
235
233
|
super().__init__(object, union_type)
|
|
236
234
|
|
|
237
235
|
|
|
238
|
-
# TODO: add EnumValue once `duckdb.enum_type` is added
|
|
236
|
+
# TODO: add EnumValue once `duckdb.enum_type` is added
|
|
239
237
|
|
|
240
238
|
__all__ = [
|
|
239
|
+
"Value",
|
|
240
|
+
"NullValue",
|
|
241
|
+
"BooleanValue",
|
|
242
|
+
"UnsignedBinaryValue",
|
|
243
|
+
"UnsignedShortValue",
|
|
244
|
+
"UnsignedIntegerValue",
|
|
245
|
+
"UnsignedLongValue",
|
|
241
246
|
"BinaryValue",
|
|
247
|
+
"ShortValue",
|
|
248
|
+
"IntegerValue",
|
|
249
|
+
"LongValue",
|
|
250
|
+
"HugeIntegerValue",
|
|
251
|
+
"UnsignedHugeIntegerValue",
|
|
252
|
+
"FloatValue",
|
|
253
|
+
"DoubleValue",
|
|
254
|
+
"DecimalValue",
|
|
255
|
+
"StringValue",
|
|
256
|
+
"UUIDValue",
|
|
242
257
|
"BitValue",
|
|
243
258
|
"BlobValue",
|
|
244
|
-
"BooleanValue",
|
|
245
259
|
"DateValue",
|
|
246
|
-
"DecimalValue",
|
|
247
|
-
"DoubleValue",
|
|
248
|
-
"FloatValue",
|
|
249
|
-
"HugeIntegerValue",
|
|
250
|
-
"IntegerValue",
|
|
251
260
|
"IntervalValue",
|
|
252
|
-
"
|
|
253
|
-
"
|
|
254
|
-
"ShortValue",
|
|
255
|
-
"StringValue",
|
|
256
|
-
"TimeTimeZoneValue",
|
|
257
|
-
"TimeValue",
|
|
261
|
+
"TimestampValue",
|
|
262
|
+
"TimestampSecondValue",
|
|
258
263
|
"TimestampMilisecondValue",
|
|
259
264
|
"TimestampNanosecondValue",
|
|
260
|
-
"TimestampSecondValue",
|
|
261
265
|
"TimestampTimeZoneValue",
|
|
262
|
-
"
|
|
263
|
-
"
|
|
264
|
-
"UnsignedBinaryValue",
|
|
265
|
-
"UnsignedHugeIntegerValue",
|
|
266
|
-
"UnsignedIntegerValue",
|
|
267
|
-
"UnsignedLongValue",
|
|
268
|
-
"UnsignedShortValue",
|
|
269
|
-
"Value",
|
|
266
|
+
"TimeValue",
|
|
267
|
+
"TimeTimeZoneValue",
|
|
270
268
|
]
|
|
@@ -54,9 +54,9 @@ class DoubleValue(Value):
|
|
|
54
54
|
def __repr__(self) -> str: ...
|
|
55
55
|
|
|
56
56
|
class DecimalValue(Value):
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
57
|
+
def __init__(self, object: Any, width: int, scale: int) -> None: ...
|
|
58
|
+
def __repr__(self) -> str: ...
|
|
59
|
+
|
|
60
60
|
class StringValue(Value):
|
|
61
61
|
def __init__(self, object: Any) -> None: ...
|
|
62
62
|
def __repr__(self) -> str: ...
|
|
@@ -109,6 +109,7 @@ class TimeTimeZoneValue(Value):
|
|
|
109
109
|
def __init__(self, object: Any) -> None: ...
|
|
110
110
|
def __repr__(self) -> str: ...
|
|
111
111
|
|
|
112
|
+
|
|
112
113
|
class Value:
|
|
113
114
|
def __init__(self, object: Any, type: DuckDBPyType) -> None: ...
|
|
114
115
|
def __repr__(self) -> str: ...
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
|
+
Name: duckdb
|
|
3
|
+
Version: 1.5.0.dev44
|
|
4
|
+
Summary: DuckDB in-process database
|
|
5
|
+
Keywords: DuckDB,Database,SQL,OLAP
|
|
6
|
+
Author: DuckDB Foundation
|
|
7
|
+
Maintainer: DuckDB Foundation
|
|
8
|
+
Classifier: Development Status :: 3 - Alpha
|
|
9
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
10
|
+
Classifier: Operating System :: OS Independent
|
|
11
|
+
Classifier: Topic :: Database
|
|
12
|
+
Classifier: Topic :: Database :: Database Engines/Servers
|
|
13
|
+
Classifier: Topic :: Scientific/Engineering
|
|
14
|
+
Classifier: Intended Audience :: Developers
|
|
15
|
+
Classifier: Intended Audience :: Education
|
|
16
|
+
Classifier: Intended Audience :: Information Technology
|
|
17
|
+
Classifier: Intended Audience :: Science/Research
|
|
18
|
+
Classifier: Programming Language :: Python
|
|
19
|
+
Classifier: Programming Language :: Python :: 3
|
|
20
|
+
Classifier: Programming Language :: Python :: 3 :: Only
|
|
21
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
22
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
23
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
24
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
25
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
26
|
+
Classifier: Programming Language :: C++
|
|
27
|
+
Project-URL: Documentation, https://duckdb.org/docs/stable/clients/python/overview
|
|
28
|
+
Project-URL: Source, https://github.com/duckdb/duckdb-python
|
|
29
|
+
Project-URL: Issues, https://github.com/duckdb/duckdb-python/issues
|
|
30
|
+
Project-URL: Changelog, https://github.com/duckdb/duckdb/releases
|
|
31
|
+
Requires-Python: >=3.9.0
|
|
32
|
+
Provides-Extra: all
|
|
33
|
+
Requires-Dist: ipython; extra == "all"
|
|
34
|
+
Requires-Dist: fsspec; extra == "all"
|
|
35
|
+
Requires-Dist: numpy; extra == "all"
|
|
36
|
+
Requires-Dist: pandas; python_version < "3.14" and extra == "all"
|
|
37
|
+
Requires-Dist: pyarrow; python_version < "3.14" and extra == "all"
|
|
38
|
+
Requires-Dist: adbc_driver_manager; python_version < "3.14" and extra == "all"
|
|
39
|
+
Description-Content-Type: text/markdown
|
|
40
|
+
|
|
41
|
+
<div align="center">
|
|
42
|
+
<picture>
|
|
43
|
+
<source media="(prefers-color-scheme: light)" srcset="https://raw.githubusercontent.com/duckdb/duckdb/refs/heads/main/logo/DuckDB_Logo-horizontal.svg">
|
|
44
|
+
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/duckdb/duckdb/refs/heads/main/logo/DuckDB_Logo-horizontal-dark-mode.svg">
|
|
45
|
+
<img alt="DuckDB logo" src="https://raw.githubusercontent.com/duckdb/duckdb/refs/heads/main/logo/DuckDB_Logo-horizontal.svg" height="100">
|
|
46
|
+
</picture>
|
|
47
|
+
</div>
|
|
48
|
+
<br />
|
|
49
|
+
<p align="center">
|
|
50
|
+
<a href="https://discord.gg/tcvwpjfnZx"><img src="https://shields.io/discord/909674491309850675" alt="Discord" /></a>
|
|
51
|
+
<a href="https://pypi.org/project/duckdb/"><img src="https://img.shields.io/pypi/v/duckdb.svg" alt="PyPI Latest Release"/></a>
|
|
52
|
+
</p>
|
|
53
|
+
<br />
|
|
54
|
+
<p align="center">
|
|
55
|
+
<a href="https://duckdb.org">DuckDB.org</a>
|
|
56
|
+
|
|
|
57
|
+
<a href="https://duckdb.org/docs/stable/guides/python/install">User Guide (Python)</a>
|
|
58
|
+
-
|
|
59
|
+
<a href="https://duckdb.org/docs/stable/clients/python/overview">API Docs (Python)</a>
|
|
60
|
+
</p>
|
|
61
|
+
|
|
62
|
+
# The [DuckDB](https://github.com/duckdb/duckdb) Python Package
|
|
63
|
+
|
|
64
|
+
## Installation
|
|
65
|
+
|
|
66
|
+
Install the latest release of DuckDB directly from [PyPI](https://pypi.org/project/duckdb/):
|
|
67
|
+
|
|
68
|
+
```bash
|
|
69
|
+
pip install duckdb
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
Install with all optional dependencies:
|
|
73
|
+
|
|
74
|
+
```bash
|
|
75
|
+
pip install 'duckdb[all]'
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
## Contributing
|
|
79
|
+
|
|
80
|
+
See the [CONTRIBUTING.md](CONTRIBUTING.md) for instructions on how to set up a development environment.
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
_duckdb.cp310-win_amd64.pyd,sha256=PKie4VoQ8vVwpjWNmmdwySoFWZmGLqwZLIfsemWB6y0,35453440
|
|
2
|
+
duckdb/__init__.py,sha256=GmG-Z_dhIy3P8e-AuGz0-rkduKa6SqMqsIot7MMJ1CA,9240
|
|
3
|
+
duckdb/__init__.pyi,sha256=_WQXdLMIiVjpJqSdHGm4a4-EjpzOPU5Mcc0AJEh3G6I,48357
|
|
4
|
+
duckdb/bytes_io_wrapper.py,sha256=o5WcKIHA6EoZTsssRNeoohLeGtCPKY-8yQw-iP1k0SY,3050
|
|
5
|
+
duckdb/experimental/__init__.py,sha256=JTAdXBrgCCenIGe3vzm7a3BuE1jOmgd9yMHG1ZEFSQA,46
|
|
6
|
+
duckdb/experimental/spark/__init__.py,sha256=BKd5s6LUBabQjxliNhs4lAZx48a81Ch5E2NHS-udU3A,291
|
|
7
|
+
duckdb/experimental/spark/_globals.py,sha256=cYR8qr7E5fMAp7vsM8CjpwoLI4-_tnuhRS4qf7b0Vr8,2511
|
|
8
|
+
duckdb/experimental/spark/_typing.py,sha256=D4Q7AvSyVgNxnmJc3nYKgt3S7cgoRbf-YWo-8Mu54jI,1573
|
|
9
|
+
duckdb/experimental/spark/conf.py,sha256=N3PqcMyyNlgJQdjLKTVA_UH_isp7657tcvurp9CU0DE,1443
|
|
10
|
+
duckdb/experimental/spark/context.py,sha256=_1A8A7mlF1QSdeQ0XjPv2ImhN4ajziW7lxo2L4Ul3Ao,6373
|
|
11
|
+
duckdb/experimental/spark/errors/__init__.py,sha256=JikuqdfaCy_Nti4A_yXYk-z1m5sXab83rovIXjKfoH4,2218
|
|
12
|
+
duckdb/experimental/spark/errors/error_classes.py,sha256=5xPdevsInQCcA8NI7Hytzh1mrmX5WvHxe4jUKzocwUc,28167
|
|
13
|
+
duckdb/experimental/spark/errors/exceptions/__init__.py,sha256=skcDKqKaQuFEltWKiUwvSpw1Kzelup5daCFKByxT-Gk,800
|
|
14
|
+
duckdb/experimental/spark/errors/exceptions/base.py,sha256=p3Pp5GQIWLBK-ApWWGOCQJ1YA0LgWgZ9_N94O08Rj-U,5577
|
|
15
|
+
duckdb/experimental/spark/errors/utils.py,sha256=EnzRDKIciMDORkbZKWrn5KJuZkKtBSCpX9ok7qmRfEo,4554
|
|
16
|
+
duckdb/experimental/spark/exception.py,sha256=r3hWeu2EZ9ri0PAyTw38aD7G5qKVsOi8YgtgXMiGfts,550
|
|
17
|
+
duckdb/experimental/spark/LICENSE,sha256=vCGc3GQQzJKXFfRiLOJCSviQBJsHHzTWjewZVVVL8zI,13646
|
|
18
|
+
duckdb/experimental/spark/sql/__init__.py,sha256=e_-3pLvS6PteoCxxCRgQHD_Mpd0JBXpbiNXTU47yjQ4,263
|
|
19
|
+
duckdb/experimental/spark/sql/_typing.py,sha256=FyJ1vvx5et2yH_YatPaLtI4Z40BK7Xwdtvw-GV13bTw,2454
|
|
20
|
+
duckdb/experimental/spark/sql/catalog.py,sha256=_8bruV2yeUk0HRhnY9lsyGRyXPLW1gtODU3V4UfIYJI,2362
|
|
21
|
+
duckdb/experimental/spark/sql/column.py,sha256=SJZWSZZTohHw7wTrS9DjpuzmPtid5Cee78I0o3Vi5hY,11076
|
|
22
|
+
duckdb/experimental/spark/sql/conf.py,sha256=eB1W0-wUa_fNJ0AAFMNxIGmhqr9a0IhPyr9Xesy-pes,679
|
|
23
|
+
duckdb/experimental/spark/sql/dataframe.py,sha256=BBeacpAuo9cjvVjC1qAsEJk5rddasuy9mIyffvGzQqM,47835
|
|
24
|
+
duckdb/experimental/spark/sql/functions.py,sha256=V_oFdX9eG-ZC9-y_1wqwYRZlge4ZmVBqxJE_BWzSU_Q,179329
|
|
25
|
+
duckdb/experimental/spark/sql/group.py,sha256=DLX16aSVFMV6xRvVJ1KCh7um09qTYJb3jQv_FQtTvy4,13695
|
|
26
|
+
duckdb/experimental/spark/sql/readwriter.py,sha256=ie5ENJX9Mxy6eBP9oNS-t5KMEQ3pfHfPvEdXDrVWGt0,17750
|
|
27
|
+
duckdb/experimental/spark/sql/session.py,sha256=XxzgYp78ZrDHyUcH42buJmODQo21-61YWF5hI3fRwsU,9290
|
|
28
|
+
duckdb/experimental/spark/sql/streaming.py,sha256=B0TyLDqG79fLU6Fz7x6TxmcoY5_o0bxziT1k479uMB8,1060
|
|
29
|
+
duckdb/experimental/spark/sql/type_utils.py,sha256=ks6YA2-4JUOHv3xrN3O6nT0d76CKVVxS0qNSS028uBE,3059
|
|
30
|
+
duckdb/experimental/spark/sql/types.py,sha256=Qqx9R65HA-WUT9MlGzy9b25RqfVdn_BW_ms6_DNRBmA,40434
|
|
31
|
+
duckdb/experimental/spark/sql/udf.py,sha256=hwWIvO0o3ipCGtmx9aUtpyC10PQ3NyQL102QB3Q1VqU,1118
|
|
32
|
+
duckdb/filesystem.py,sha256=WMVzCQ2gbe9T60hMw7aAajVqUOHRJvG0XvfgMkKi6hg,1019
|
|
33
|
+
duckdb/functional/__init__.py,sha256=d8qY_IjItw-81ZWXnE_cLmgmEeHzRcmwaEPqHKf_ej8,229
|
|
34
|
+
duckdb/functional/__init__.pyi,sha256=02Yn2rP7YVGnJmCZsXnuvteurPc60qgfy0JEyTi5DNA,805
|
|
35
|
+
duckdb/polars_io.py,sha256=0ezW1ZiII_A3N4GjJDDieCKb6uE4swZXFMxVUgEOmPQ,8221
|
|
36
|
+
duckdb/query_graph/__main__.py,sha256=BWDGf2LKiSXHhQWbIuvc-IXTjE_DqYISGvmtSBBYcx0,11622
|
|
37
|
+
duckdb/typing/__init__.py,sha256=Z5Bd4OzV8NWzrzeo06evSDTbwcknZBAgzCapxgaKEWM,915
|
|
38
|
+
duckdb/typing/__init__.pyi,sha256=sshKVD1s7TqWGCZvVKMVmZe64SsRUZHIt8f5gZ_CPxA,963
|
|
39
|
+
duckdb/udf.py,sha256=-Y1DTF3uZgvufqO7ihvWXbFqWHu8LSME48NLyOeQKEk,693
|
|
40
|
+
duckdb/value/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
41
|
+
duckdb/value/__init__.pyi,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
42
|
+
duckdb/value/constant/__init__.py,sha256=cbTGO63hXI7tkoa6Sjw2S_PJYV6IAC8R88n2yVzPuNo,5784
|
|
43
|
+
duckdb/value/constant/__init__.pyi,sha256=Q51_wc2jVyBE7tzeH5X49e6XCs4JJD8a9asX-nqw4ow,3394
|
|
44
|
+
duckdb-1.5.0.dev44.dist-info/METADATA,sha256=1A8dQZJ9rYvH1GlsxEV4BEzQLbz5-OwzufESShEj2hI,3251
|
|
45
|
+
duckdb-1.5.0.dev44.dist-info/WHEEL,sha256=hrGeChGtn46HBGmzasO9QQDSLelRN-tUarBSv4gFcsI,106
|
|
46
|
+
duckdb-1.5.0.dev44.dist-info/licenses/LICENSE,sha256=QACFao8AflP8UxUFM9ZEvK78ZLdGHkPBTMudPWalnNI,1079
|
|
47
|
+
duckdb-1.5.0.dev44.dist-info/RECORD,,
|
adbc_driver_duckdb/__init__.py
DELETED
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
# Licensed to the Apache Software Foundation (ASF) under one
|
|
2
|
-
# or more contributor license agreements. See the NOTICE file
|
|
3
|
-
# distributed with this work for additional information
|
|
4
|
-
# regarding copyright ownership. The ASF licenses this file
|
|
5
|
-
# to you under the Apache License, Version 2.0 (the
|
|
6
|
-
# "License"); you may not use this file except in compliance
|
|
7
|
-
# with the License. You may obtain a copy of the License at
|
|
8
|
-
#
|
|
9
|
-
# http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
-
#
|
|
11
|
-
# Unless required by applicable law or agreed to in writing,
|
|
12
|
-
# software distributed under the License is distributed on an
|
|
13
|
-
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
14
|
-
# KIND, either express or implied. See the License for the
|
|
15
|
-
# specific language governing permissions and limitations
|
|
16
|
-
# under the License.
|
|
17
|
-
|
|
18
|
-
"""Low-level ADBC bindings for the DuckDB driver."""
|
|
19
|
-
|
|
20
|
-
import enum
|
|
21
|
-
import functools
|
|
22
|
-
import importlib
|
|
23
|
-
import typing
|
|
24
|
-
|
|
25
|
-
import adbc_driver_manager
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
class StatementOptions(enum.Enum):
|
|
29
|
-
"""Statement options specific to the DuckDB driver."""
|
|
30
|
-
|
|
31
|
-
#: The number of rows per batch. Defaults to 2048.
|
|
32
|
-
BATCH_ROWS = "adbc.duckdb.query.batch_rows"
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
def connect(path: typing.Optional[str] = None) -> adbc_driver_manager.AdbcDatabase:
|
|
36
|
-
"""Create a low level ADBC connection to DuckDB."""
|
|
37
|
-
if path is None:
|
|
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)
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
@functools.cache
|
|
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
DELETED
|
@@ -1,115 +0,0 @@
|
|
|
1
|
-
# Licensed to the Apache Software Foundation (ASF) under one
|
|
2
|
-
# or more contributor license agreements. See the NOTICE file
|
|
3
|
-
# distributed with this work for additional information
|
|
4
|
-
# regarding copyright ownership. The ASF licenses this file
|
|
5
|
-
# to you under the Apache License, Version 2.0 (the
|
|
6
|
-
# "License"); you may not use this file except in compliance
|
|
7
|
-
# with the License. You may obtain a copy of the License at
|
|
8
|
-
#
|
|
9
|
-
# http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
-
#
|
|
11
|
-
# Unless required by applicable law or agreed to in writing,
|
|
12
|
-
# software distributed under the License is distributed on an
|
|
13
|
-
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
14
|
-
# KIND, either express or implied. See the License for the
|
|
15
|
-
# specific language governing permissions and limitations
|
|
16
|
-
# under the License.
|
|
17
|
-
|
|
18
|
-
"""DBAPI 2.0-compatible facade for the ADBC DuckDB driver."""
|
|
19
|
-
|
|
20
|
-
import typing
|
|
21
|
-
|
|
22
|
-
import adbc_driver_manager
|
|
23
|
-
import adbc_driver_manager.dbapi
|
|
24
|
-
|
|
25
|
-
import adbc_driver_duckdb
|
|
26
|
-
|
|
27
|
-
__all__ = [
|
|
28
|
-
"BINARY",
|
|
29
|
-
"DATETIME",
|
|
30
|
-
"NUMBER",
|
|
31
|
-
"ROWID",
|
|
32
|
-
"STRING",
|
|
33
|
-
"Connection",
|
|
34
|
-
"Cursor",
|
|
35
|
-
"DataError",
|
|
36
|
-
"DatabaseError",
|
|
37
|
-
"Date",
|
|
38
|
-
"DateFromTicks",
|
|
39
|
-
"Error",
|
|
40
|
-
"IntegrityError",
|
|
41
|
-
"InterfaceError",
|
|
42
|
-
"InternalError",
|
|
43
|
-
"NotSupportedError",
|
|
44
|
-
"OperationalError",
|
|
45
|
-
"ProgrammingError",
|
|
46
|
-
"Time",
|
|
47
|
-
"TimeFromTicks",
|
|
48
|
-
"Timestamp",
|
|
49
|
-
"TimestampFromTicks",
|
|
50
|
-
"Warning",
|
|
51
|
-
"apilevel",
|
|
52
|
-
"connect",
|
|
53
|
-
"paramstyle",
|
|
54
|
-
"threadsafety",
|
|
55
|
-
]
|
|
56
|
-
|
|
57
|
-
# ----------------------------------------------------------
|
|
58
|
-
# Globals
|
|
59
|
-
|
|
60
|
-
apilevel = adbc_driver_manager.dbapi.apilevel
|
|
61
|
-
threadsafety = adbc_driver_manager.dbapi.threadsafety
|
|
62
|
-
paramstyle = "qmark"
|
|
63
|
-
|
|
64
|
-
Warning = adbc_driver_manager.dbapi.Warning
|
|
65
|
-
Error = adbc_driver_manager.dbapi.Error
|
|
66
|
-
InterfaceError = adbc_driver_manager.dbapi.InterfaceError
|
|
67
|
-
DatabaseError = adbc_driver_manager.dbapi.DatabaseError
|
|
68
|
-
DataError = adbc_driver_manager.dbapi.DataError
|
|
69
|
-
OperationalError = adbc_driver_manager.dbapi.OperationalError
|
|
70
|
-
IntegrityError = adbc_driver_manager.dbapi.IntegrityError
|
|
71
|
-
InternalError = adbc_driver_manager.dbapi.InternalError
|
|
72
|
-
ProgrammingError = adbc_driver_manager.dbapi.ProgrammingError
|
|
73
|
-
NotSupportedError = adbc_driver_manager.dbapi.NotSupportedError
|
|
74
|
-
|
|
75
|
-
# ----------------------------------------------------------
|
|
76
|
-
# Types
|
|
77
|
-
|
|
78
|
-
Date = adbc_driver_manager.dbapi.Date
|
|
79
|
-
Time = adbc_driver_manager.dbapi.Time
|
|
80
|
-
Timestamp = adbc_driver_manager.dbapi.Timestamp
|
|
81
|
-
DateFromTicks = adbc_driver_manager.dbapi.DateFromTicks
|
|
82
|
-
TimeFromTicks = adbc_driver_manager.dbapi.TimeFromTicks
|
|
83
|
-
TimestampFromTicks = adbc_driver_manager.dbapi.TimestampFromTicks
|
|
84
|
-
STRING = adbc_driver_manager.dbapi.STRING
|
|
85
|
-
BINARY = adbc_driver_manager.dbapi.BINARY
|
|
86
|
-
NUMBER = adbc_driver_manager.dbapi.NUMBER
|
|
87
|
-
DATETIME = adbc_driver_manager.dbapi.DATETIME
|
|
88
|
-
ROWID = adbc_driver_manager.dbapi.ROWID
|
|
89
|
-
|
|
90
|
-
# ----------------------------------------------------------
|
|
91
|
-
# Functions
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
def connect(path: typing.Optional[str] = None, **kwargs) -> "Connection":
|
|
95
|
-
"""Connect to DuckDB via ADBC."""
|
|
96
|
-
db = None
|
|
97
|
-
conn = None
|
|
98
|
-
|
|
99
|
-
try:
|
|
100
|
-
db = adbc_driver_duckdb.connect(path)
|
|
101
|
-
conn = adbc_driver_manager.AdbcConnection(db)
|
|
102
|
-
return adbc_driver_manager.dbapi.Connection(db, conn, **kwargs)
|
|
103
|
-
except Exception:
|
|
104
|
-
if conn:
|
|
105
|
-
conn.close()
|
|
106
|
-
if db:
|
|
107
|
-
db.close()
|
|
108
|
-
raise
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
# ----------------------------------------------------------
|
|
112
|
-
# Classes
|
|
113
|
-
|
|
114
|
-
Connection = adbc_driver_manager.dbapi.Connection
|
|
115
|
-
Cursor = adbc_driver_manager.dbapi.Cursor
|