duckdb 0.8.2.dev3007__cp311-cp311-win_amd64.whl → 1.4.3.dev8__cp311-cp311-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.
Files changed (72) hide show
  1. _duckdb-stubs/__init__.pyi +1478 -0
  2. _duckdb-stubs/_func.pyi +46 -0
  3. _duckdb-stubs/_sqltypes.pyi +75 -0
  4. duckdb/duckdb.cp311-win_amd64.pyd → _duckdb.cp311-win_amd64.pyd +0 -0
  5. adbc_driver_duckdb/__init__.py +10 -8
  6. adbc_driver_duckdb/dbapi.py +4 -5
  7. duckdb/__init__.py +250 -196
  8. duckdb/_dbapi_type_object.py +231 -0
  9. duckdb/_version.py +22 -0
  10. {pyduckdb → duckdb}/bytes_io_wrapper.py +12 -8
  11. duckdb/experimental/__init__.py +5 -0
  12. duckdb/experimental/spark/__init__.py +6 -0
  13. {pyduckdb → duckdb/experimental}/spark/_globals.py +8 -8
  14. duckdb/experimental/spark/_typing.py +46 -0
  15. duckdb/experimental/spark/conf.py +46 -0
  16. duckdb/experimental/spark/context.py +180 -0
  17. duckdb/experimental/spark/errors/__init__.py +70 -0
  18. duckdb/experimental/spark/errors/error_classes.py +918 -0
  19. duckdb/experimental/spark/errors/exceptions/__init__.py +16 -0
  20. duckdb/experimental/spark/errors/exceptions/base.py +168 -0
  21. duckdb/experimental/spark/errors/utils.py +111 -0
  22. duckdb/experimental/spark/exception.py +18 -0
  23. {pyduckdb → duckdb/experimental}/spark/sql/__init__.py +5 -5
  24. duckdb/experimental/spark/sql/_typing.py +86 -0
  25. duckdb/experimental/spark/sql/catalog.py +79 -0
  26. duckdb/experimental/spark/sql/column.py +361 -0
  27. duckdb/experimental/spark/sql/conf.py +24 -0
  28. duckdb/experimental/spark/sql/dataframe.py +1389 -0
  29. duckdb/experimental/spark/sql/functions.py +6195 -0
  30. duckdb/experimental/spark/sql/group.py +424 -0
  31. duckdb/experimental/spark/sql/readwriter.py +435 -0
  32. duckdb/experimental/spark/sql/session.py +297 -0
  33. duckdb/experimental/spark/sql/streaming.py +36 -0
  34. duckdb/experimental/spark/sql/type_utils.py +107 -0
  35. {pyduckdb → duckdb/experimental}/spark/sql/types.py +323 -342
  36. duckdb/experimental/spark/sql/udf.py +37 -0
  37. duckdb/filesystem.py +33 -0
  38. duckdb/func/__init__.py +3 -0
  39. duckdb/functional/__init__.py +12 -16
  40. duckdb/polars_io.py +284 -0
  41. duckdb/py.typed +0 -0
  42. duckdb/query_graph/__main__.py +358 -0
  43. duckdb/sqltypes/__init__.py +63 -0
  44. duckdb/typing/__init__.py +18 -6
  45. {pyduckdb → duckdb}/udf.py +10 -5
  46. duckdb/value/__init__.py +1 -0
  47. pyduckdb/value/constant.py → duckdb/value/constant/__init__.py +66 -57
  48. duckdb-1.4.3.dev8.dist-info/METADATA +88 -0
  49. duckdb-1.4.3.dev8.dist-info/RECORD +52 -0
  50. {duckdb-0.8.2.dev3007.dist-info → duckdb-1.4.3.dev8.dist-info}/WHEEL +1 -1
  51. duckdb-1.4.3.dev8.dist-info/licenses/LICENSE +7 -0
  52. duckdb-0.8.2.dev3007.dist-info/METADATA +0 -20
  53. duckdb-0.8.2.dev3007.dist-info/RECORD +0 -34
  54. duckdb-0.8.2.dev3007.dist-info/top_level.txt +0 -4
  55. duckdb-stubs/__init__.pyi +0 -574
  56. duckdb-stubs/functional/__init__.pyi +0 -33
  57. duckdb-stubs/typing/__init__.pyi +0 -35
  58. pyduckdb/__init__.py +0 -61
  59. pyduckdb/filesystem.py +0 -64
  60. pyduckdb/spark/__init__.py +0 -7
  61. pyduckdb/spark/conf.py +0 -45
  62. pyduckdb/spark/context.py +0 -162
  63. pyduckdb/spark/exception.py +0 -9
  64. pyduckdb/spark/sql/catalog.py +0 -78
  65. pyduckdb/spark/sql/conf.py +0 -23
  66. pyduckdb/spark/sql/dataframe.py +0 -75
  67. pyduckdb/spark/sql/readwriter.py +0 -180
  68. pyduckdb/spark/sql/session.py +0 -249
  69. pyduckdb/spark/sql/streaming.py +0 -37
  70. pyduckdb/spark/sql/type_utils.py +0 -104
  71. pyduckdb/spark/sql/udf.py +0 -9
  72. {pyduckdb → duckdb/experimental}/spark/LICENSE +0 -0
duckdb/__init__.py CHANGED
@@ -1,137 +1,96 @@
1
- _exported_symbols = []
1
+ # ruff: noqa: F401
2
+ """The DuckDB Python Package.
2
3
 
3
- # Modules
4
- import duckdb.functional as functional
5
- import duckdb.typing as typing
6
- _exported_symbols.extend([
7
- "typing",
8
- "functional"
9
- ])
4
+ This module re-exports the DuckDB C++ extension (`_duckdb`) and provides DuckDB's public API.
10
5
 
11
- # Classes
12
- from .duckdb import (
13
- DuckDBPyRelation,
6
+ Note:
7
+ - Some symbols exposed here are implementation details of DuckDB's C++ engine.
8
+ - They are kept for backwards compatibility but are not considered stable API.
9
+ - Future versions may move them into submodules with deprecation warnings.
10
+ """
11
+
12
+ from _duckdb import (
13
+ BinderException,
14
+ CaseExpression,
15
+ CatalogException,
16
+ CoalesceOperator,
17
+ ColumnExpression,
18
+ ConnectionException,
19
+ ConstantExpression,
20
+ ConstraintException,
21
+ ConversionException,
22
+ CSVLineTerminator,
23
+ DatabaseError,
24
+ DataError,
25
+ DefaultExpression,
26
+ DependencyException,
14
27
  DuckDBPyConnection,
28
+ DuckDBPyRelation,
29
+ Error,
30
+ ExpectedResultType,
15
31
  ExplainType,
16
- PythonExceptionHandling
17
- )
18
- _exported_symbols.extend([
19
- "DuckDBPyRelation",
20
- "DuckDBPyConnection",
21
- "ExplainType",
22
- "PythonExceptionHandling"
23
- ])
24
-
25
- # Enums
26
- from .duckdb import (
27
- ANALYZE,
28
- DEFAULT,
29
- RETURN_NULL,
30
- STANDARD
31
- )
32
- _exported_symbols.extend([
33
- "ANALYZE",
34
- "DEFAULT",
35
- "RETURN_NULL",
36
- "STANDARD"
37
- ])
38
-
39
- # Type-creation methods
40
- from .duckdb import (
41
- struct_type,
42
- list_type,
43
- array_type,
44
- decimal_type
45
- )
46
- _exported_symbols.extend([
47
- "struct_type",
48
- "list_type",
49
- "array_type",
50
- "decimal_type"
51
- ])
52
-
53
- # read-only properties
54
- from .duckdb import (
55
- __standard_vector_size__,
32
+ Expression,
33
+ FatalException,
34
+ FunctionExpression,
35
+ HTTPException,
36
+ IntegrityError,
37
+ InternalError,
38
+ InternalException,
39
+ InterruptException,
40
+ InvalidInputException,
41
+ InvalidTypeException,
42
+ IOException,
43
+ LambdaExpression,
44
+ NotImplementedException,
45
+ NotSupportedError,
46
+ OperationalError,
47
+ OutOfMemoryException,
48
+ OutOfRangeException,
49
+ ParserException,
50
+ PermissionException,
51
+ ProgrammingError,
52
+ PythonExceptionHandling,
53
+ RenderMode,
54
+ SequenceException,
55
+ SerializationException,
56
+ SQLExpression,
57
+ StarExpression,
58
+ Statement,
59
+ StatementType,
60
+ SyntaxException,
61
+ TransactionException,
62
+ TypeMismatchException,
63
+ Warning,
64
+ __formatted_python_version__,
65
+ __git_revision__,
56
66
  __interactive__,
57
67
  __jupyter__,
58
- __version__,
59
- apilevel,
60
- comment,
61
- default_connection,
62
- identifier,
63
- keyword,
64
- numeric_const,
65
- operator,
66
- paramstyle,
67
- string_const,
68
- threadsafety,
69
- token_type,
70
- tokenize
71
- )
72
- _exported_symbols.extend([
73
- "__standard_vector_size__",
74
- "__interactive__",
75
- "__jupyter__",
76
- "__version__",
77
- "apilevel",
78
- "comment",
79
- "default_connection",
80
- "identifier",
81
- "keyword",
82
- "numeric_const",
83
- "operator",
84
- "paramstyle",
85
- "string_const",
86
- "threadsafety",
87
- "token_type",
88
- "tokenize"
89
- ])
90
-
91
- from .duckdb import (
92
- filter,
93
- project,
68
+ __standard_vector_size__,
69
+ _clean_default_connection,
94
70
  aggregate,
95
- distinct,
96
- limit,
97
- query_df,
98
- order,
99
71
  alias,
100
- connect,
101
- write_csv
102
- )
103
- _exported_symbols.extend([
104
- "filter",
105
- "project",
106
- "aggregate",
107
- "distinct",
108
- "limit",
109
- "query_df",
110
- "order",
111
- "alias",
112
- "connect",
113
- "write_csv"
114
- ])
115
-
116
- # TODO: might be worth seeing if these methods can be replaced with a pure-python solution
117
- # Connection methods
118
- from .duckdb import (
72
+ apilevel,
119
73
  append,
120
74
  array_type,
121
75
  arrow,
122
76
  begin,
77
+ checkpoint,
123
78
  close,
124
79
  commit,
80
+ connect,
125
81
  create_function,
126
82
  cursor,
127
83
  decimal_type,
84
+ default_connection,
128
85
  description,
129
86
  df,
87
+ distinct,
130
88
  dtype,
131
89
  duplicate,
132
90
  enum_type,
133
91
  execute,
134
92
  executemany,
93
+ extract_statements,
135
94
  fetch_arrow_table,
136
95
  fetch_df,
137
96
  fetch_df_chunk,
@@ -142,24 +101,27 @@ from .duckdb import (
142
101
  fetchnumpy,
143
102
  fetchone,
144
103
  filesystem_is_registered,
104
+ filter,
145
105
  from_arrow,
146
106
  from_csv_auto,
147
107
  from_df,
148
108
  from_parquet,
149
109
  from_query,
150
- from_substrait,
151
- from_substrait_json,
152
- get_substrait,
153
- get_substrait_json,
154
110
  get_table_names,
155
111
  install_extension,
156
112
  interrupt,
113
+ limit,
157
114
  list_filesystems,
158
115
  list_type,
159
116
  load_extension,
160
117
  map_type,
118
+ order,
119
+ paramstyle,
161
120
  pl,
121
+ project,
162
122
  query,
123
+ query_df,
124
+ query_progress,
163
125
  read_csv,
164
126
  read_json,
165
127
  read_parquet,
@@ -168,6 +130,8 @@ from .duckdb import (
168
130
  remove_function,
169
131
  rollback,
170
132
  row_type,
133
+ rowcount,
134
+ set_default_connection,
171
135
  sql,
172
136
  sqltype,
173
137
  string_type,
@@ -175,31 +139,184 @@ from .duckdb import (
175
139
  table,
176
140
  table_function,
177
141
  tf,
142
+ threadsafety,
143
+ token_type,
144
+ tokenize,
178
145
  torch,
179
146
  type,
180
147
  union_type,
181
148
  unregister,
182
149
  unregister_filesystem,
183
150
  values,
184
- view
151
+ view,
152
+ write_csv,
153
+ )
154
+
155
+ from duckdb._dbapi_type_object import (
156
+ BINARY,
157
+ DATETIME,
158
+ NUMBER,
159
+ ROWID,
160
+ STRING,
161
+ DBAPITypeObject,
185
162
  )
186
- _exported_symbols.extend([
163
+ from duckdb._version import (
164
+ __duckdb_version__,
165
+ __version__,
166
+ version,
167
+ )
168
+ from duckdb.value.constant import (
169
+ BinaryValue,
170
+ BitValue,
171
+ BlobValue,
172
+ BooleanValue,
173
+ DateValue,
174
+ DecimalValue,
175
+ DoubleValue,
176
+ FloatValue,
177
+ HugeIntegerValue,
178
+ IntegerValue,
179
+ IntervalValue,
180
+ ListValue,
181
+ LongValue,
182
+ MapValue,
183
+ NullValue,
184
+ ShortValue,
185
+ StringValue,
186
+ StructValue,
187
+ TimestampMilisecondValue,
188
+ TimestampNanosecondValue,
189
+ TimestampSecondValue,
190
+ TimestampTimeZoneValue,
191
+ TimestampValue,
192
+ TimeTimeZoneValue,
193
+ TimeValue,
194
+ UnionType,
195
+ UnsignedBinaryValue,
196
+ UnsignedHugeIntegerValue,
197
+ UnsignedIntegerValue,
198
+ UnsignedLongValue,
199
+ UnsignedShortValue,
200
+ UUIDValue,
201
+ Value,
202
+ )
203
+
204
+ __all__: list[str] = [
205
+ "BinaryValue",
206
+ "BinderException",
207
+ "BitValue",
208
+ "BlobValue",
209
+ "BooleanValue",
210
+ "CSVLineTerminator",
211
+ "CaseExpression",
212
+ "CatalogException",
213
+ "CoalesceOperator",
214
+ "ColumnExpression",
215
+ "ConnectionException",
216
+ "ConstantExpression",
217
+ "ConstraintException",
218
+ "ConversionException",
219
+ "DataError",
220
+ "DatabaseError",
221
+ "DateValue",
222
+ "DecimalValue",
223
+ "DefaultExpression",
224
+ "DependencyException",
225
+ "DoubleValue",
226
+ "DuckDBPyConnection",
227
+ "DuckDBPyRelation",
228
+ "Error",
229
+ "ExpectedResultType",
230
+ "ExplainType",
231
+ "Expression",
232
+ "FatalException",
233
+ "FloatValue",
234
+ "FunctionExpression",
235
+ "HTTPException",
236
+ "HugeIntegerValue",
237
+ "IOException",
238
+ "IntegerValue",
239
+ "IntegrityError",
240
+ "InternalError",
241
+ "InternalException",
242
+ "InterruptException",
243
+ "IntervalValue",
244
+ "InvalidInputException",
245
+ "InvalidTypeException",
246
+ "LambdaExpression",
247
+ "ListValue",
248
+ "LongValue",
249
+ "MapValue",
250
+ "NotImplementedException",
251
+ "NotSupportedError",
252
+ "NullValue",
253
+ "OperationalError",
254
+ "OutOfMemoryException",
255
+ "OutOfRangeException",
256
+ "ParserException",
257
+ "PermissionException",
258
+ "ProgrammingError",
259
+ "PythonExceptionHandling",
260
+ "RenderMode",
261
+ "SQLExpression",
262
+ "SequenceException",
263
+ "SerializationException",
264
+ "ShortValue",
265
+ "StarExpression",
266
+ "Statement",
267
+ "StatementType",
268
+ "StringValue",
269
+ "StructValue",
270
+ "SyntaxException",
271
+ "TimeTimeZoneValue",
272
+ "TimeValue",
273
+ "TimestampMilisecondValue",
274
+ "TimestampNanosecondValue",
275
+ "TimestampSecondValue",
276
+ "TimestampTimeZoneValue",
277
+ "TimestampValue",
278
+ "TransactionException",
279
+ "TypeMismatchException",
280
+ "UUIDValue",
281
+ "UnionType",
282
+ "UnsignedBinaryValue",
283
+ "UnsignedHugeIntegerValue",
284
+ "UnsignedIntegerValue",
285
+ "UnsignedLongValue",
286
+ "UnsignedShortValue",
287
+ "Value",
288
+ "Warning",
289
+ "__formatted_python_version__",
290
+ "__git_revision__",
291
+ "__interactive__",
292
+ "__jupyter__",
293
+ "__standard_vector_size__",
294
+ "__version__",
295
+ "_clean_default_connection",
296
+ "aggregate",
297
+ "alias",
298
+ "apilevel",
187
299
  "append",
188
300
  "array_type",
189
301
  "arrow",
190
302
  "begin",
303
+ "checkpoint",
191
304
  "close",
192
305
  "commit",
306
+ "connect",
193
307
  "create_function",
194
308
  "cursor",
195
309
  "decimal_type",
310
+ "default_connection",
196
311
  "description",
197
312
  "df",
313
+ "distinct",
198
314
  "dtype",
199
315
  "duplicate",
200
316
  "enum_type",
201
317
  "execute",
202
318
  "executemany",
319
+ "extract_statements",
203
320
  "fetch_arrow_table",
204
321
  "fetch_df",
205
322
  "fetch_df_chunk",
@@ -210,24 +327,28 @@ _exported_symbols.extend([
210
327
  "fetchnumpy",
211
328
  "fetchone",
212
329
  "filesystem_is_registered",
330
+ "filter",
213
331
  "from_arrow",
214
332
  "from_csv_auto",
215
333
  "from_df",
216
334
  "from_parquet",
217
335
  "from_query",
218
- "from_substrait",
219
- "from_substrait_json",
220
- "get_substrait",
221
- "get_substrait_json",
222
336
  "get_table_names",
223
337
  "install_extension",
224
338
  "interrupt",
339
+ "limit",
225
340
  "list_filesystems",
226
341
  "list_type",
227
342
  "load_extension",
228
343
  "map_type",
344
+ "order",
345
+ "paramstyle",
346
+ "paramstyle",
229
347
  "pl",
348
+ "project",
230
349
  "query",
350
+ "query_df",
351
+ "query_progress",
231
352
  "read_csv",
232
353
  "read_json",
233
354
  "read_parquet",
@@ -236,6 +357,8 @@ _exported_symbols.extend([
236
357
  "remove_function",
237
358
  "rollback",
238
359
  "row_type",
360
+ "rowcount",
361
+ "set_default_connection",
239
362
  "sql",
240
363
  "sqltype",
241
364
  "string_type",
@@ -243,85 +366,16 @@ _exported_symbols.extend([
243
366
  "table",
244
367
  "table_function",
245
368
  "tf",
369
+ "threadsafety",
370
+ "threadsafety",
371
+ "token_type",
372
+ "tokenize",
246
373
  "torch",
247
374
  "type",
248
375
  "union_type",
249
376
  "unregister",
250
377
  "unregister_filesystem",
251
378
  "values",
252
- "view"
253
- ])
254
-
255
- # Exceptions
256
- from .duckdb import (
257
- Error,
258
- DataError,
259
- CastException,
260
- ConversionException,
261
- OutOfRangeException,
262
- TypeMismatchException,
263
- ValueOutOfRangeException,
264
- FatalException,
265
- IntegrityError,
266
- ConstraintException,
267
- InternalError,
268
- InternalException,
269
- InterruptException,
270
- NotSupportedError,
271
- NotImplementedException,
272
- OperationalError,
273
- ConnectionException,
274
- IOException,
275
- HTTPException,
276
- OutOfMemoryException,
277
- SerializationException,
278
- TransactionException,
279
- PermissionException,
280
- ProgrammingError,
281
- BinderException,
282
- CatalogException,
283
- InvalidInputException,
284
- InvalidTypeException,
285
- ParserException,
286
- SyntaxException,
287
- SequenceException,
288
- StandardException,
289
- Warning
290
- )
291
- _exported_symbols.extend([
292
- "Error",
293
- "DataError",
294
- "CastException",
295
- "ConversionException",
296
- "OutOfRangeException",
297
- "TypeMismatchException",
298
- "ValueOutOfRangeException",
299
- "FatalException",
300
- "IntegrityError",
301
- "ConstraintException",
302
- "InternalError",
303
- "InternalException",
304
- "InterruptException",
305
- "NotSupportedError",
306
- "NotImplementedException",
307
- "OperationalError",
308
- "ConnectionException",
309
- "IOException",
310
- "HTTPException",
311
- "OutOfMemoryException",
312
- "SerializationException",
313
- "TransactionException",
314
- "PermissionException",
315
- "ProgrammingError",
316
- "BinderException",
317
- "CatalogException",
318
- "InvalidInputException",
319
- "InvalidTypeException",
320
- "ParserException",
321
- "SyntaxException",
322
- "SequenceException",
323
- "StandardException",
324
- "Warning"
325
- ])
326
-
327
- __all__ = _exported_symbols
379
+ "view",
380
+ "write_csv",
381
+ ]