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-stubs/__init__.pyi DELETED
@@ -1,574 +0,0 @@
1
- # to regenerate this from scratch, run scripts/regenerate_python_stubs.sh .
2
- # be warned - currently there are still tweaks needed after this file is
3
- # generated. These should be annotated with a comment like
4
- # # stubgen override
5
- # to help the sanity of maintainers.
6
-
7
- import duckdb.typing as typing
8
- import duckdb.functional as functional
9
- from duckdb.typing import DuckDBPyType
10
- from duckdb.functional import FunctionNullHandling, PythonUDFType
11
-
12
- # We also run this in python3.7, where this is needed
13
- from typing_extensions import Literal
14
- # stubgen override - missing import of Set
15
- from typing import Any, ClassVar, Set, Optional, Callable
16
- from io import StringIO, TextIOBase
17
-
18
- from typing import overload, Dict, List, Union
19
- import pandas
20
- # stubgen override - unfortunately we need this for version checks
21
- import sys
22
- import fsspec
23
- import pyarrow.lib
24
- import polars
25
- # stubgen override - This should probably not be exposed
26
- apilevel: str
27
- comment: token_type
28
- default_connection: DuckDBPyConnection
29
- identifier: token_type
30
- keyword: token_type
31
- numeric_const: token_type
32
- operator: token_type
33
- paramstyle: str
34
- string_const: token_type
35
- threadsafety: int
36
- __standard_vector_size__: int
37
- STANDARD: ExplainType
38
- ANALYZE: ExplainType
39
- DEFAULT: PythonExceptionHandling
40
- RETURN_NULL: PythonExceptionHandling
41
-
42
- __version__: str
43
-
44
- __interactive__: bool
45
- __jupyter__: bool
46
-
47
- class BinderException(ProgrammingError): ...
48
-
49
- class CastException(DataError): ...
50
-
51
- class CatalogException(ProgrammingError): ...
52
-
53
- class ConnectionException(OperationalError): ...
54
-
55
- class ConstraintException(IntegrityError): ...
56
-
57
- class ConversionException(DataError): ...
58
-
59
- class DataError(Error): ...
60
-
61
- class ExplainType:
62
- STANDARD: ExplainType
63
- ANALYZE: ExplainType
64
- def __int__(self) -> int: ...
65
- def __index__(self) -> int: ...
66
- @property
67
- def __members__(self) -> Dict[str, ExplainType]: ...
68
- @property
69
- def name(self) -> str: ...
70
- @property
71
- def value(self) -> int: ...
72
-
73
- class PythonExceptionHandling:
74
- DEFAULT: PythonExceptionHandling
75
- RETURN_NULL: PythonExceptionHandling
76
- def __int__(self) -> int: ...
77
- def __index__(self) -> int: ...
78
- @property
79
- def __members__(self) -> Dict[str, PythonExceptionHandling]: ...
80
- @property
81
- def name(self) -> str: ...
82
- @property
83
- def value(self) -> int: ...
84
-
85
- class DuckDBPyConnection:
86
- def __init__(self, *args, **kwargs) -> None: ...
87
- def append(self, table_name: str, df: pandas.DataFrame) -> DuckDBPyConnection: ...
88
- def arrow(self, rows_per_batch: int = ...) -> pyarrow.lib.Table: ...
89
- def begin(self) -> DuckDBPyConnection: ...
90
- def close(self) -> None: ...
91
- def commit(self) -> DuckDBPyConnection: ...
92
- def cursor(self) -> DuckDBPyConnection: ...
93
- def df(self) -> pandas.DataFrame: ...
94
- def duplicate(self) -> DuckDBPyConnection: ...
95
- def execute(self, query: str, parameters: object = ..., multiple_parameter_sets: bool = ...) -> DuckDBPyConnection: ...
96
- def executemany(self, query: str, parameters: object = ...) -> DuckDBPyConnection: ...
97
- def fetch_arrow_table(self, rows_per_batch: int = ...) -> pyarrow.lib.Table: ...
98
- def fetch_df(self, *args, **kwargs) -> pandas.DataFrame: ...
99
- def fetch_df_chunk(self, *args, **kwargs) -> pandas.DataFrame: ...
100
- def fetch_record_batch(self, rows_per_batch: int = ...) -> pyarrow.lib.RecordBatchReader: ...
101
- def fetchall(self) -> list: ...
102
- def fetchdf(self, *args, **kwargs) -> pandas.DataFrame: ...
103
- def fetchmany(self, size: int = ...) -> list: ...
104
- def fetchnumpy(self) -> dict: ...
105
- def fetchone(self) -> Optional[tuple]: ...
106
- def from_arrow(self, arrow_object: object) -> DuckDBPyRelation: ...
107
- def read_json(
108
- self,
109
- file_name: str,
110
- columns: Optional[Dict[str,str]] = None,
111
- sample_size: Optional[int] = None,
112
- maximum_depth: Optional[int] = None,
113
- records: Optional[str] = None,
114
- format: Optional[str] = None
115
- ) -> DuckDBPyRelation: ...
116
- def read_csv(
117
- self,
118
- path_or_buffer: Union[str, StringIO, TextIOBase],
119
- header: Optional[bool | int] = None,
120
- compression: Optional[str] = None,
121
- sep: Optional[str] = None,
122
- delimiter: Optional[str] = None,
123
- dtype: Optional[Dict[str, str] | List[str]] = None,
124
- na_values: Optional[str] = None,
125
- skiprows: Optional[int] = None,
126
- quotechar: Optional[str] = None,
127
- escapechar: Optional[str] = None,
128
- encoding: Optional[str] = None,
129
- parallel: Optional[bool] = None,
130
- date_format: Optional[str] = None,
131
- timestamp_format: Optional[str] = None,
132
- sample_size: Optional[int] = None,
133
- all_varchar: Optional[bool] = None,
134
- normalize_names: Optional[bool] = None,
135
- filename: Optional[bool] = None,
136
- ) -> DuckDBPyRelation: ...
137
- def from_csv_auto(
138
- self,
139
- name: str,
140
- header: Optional[bool | int] = None,
141
- compression: Optional[str] = None,
142
- sep: Optional[str] = None,
143
- delimiter: Optional[str] = None,
144
- dtype: Optional[Dict[str, str] | List[str]] = None,
145
- na_values: Optional[str] = None,
146
- skiprows: Optional[int] = None,
147
- quotechar: Optional[str] = None,
148
- escapechar: Optional[str] = None,
149
- encoding: Optional[str] = None,
150
- parallel: Optional[bool] = None,
151
- date_format: Optional[str] = None,
152
- timestamp_format: Optional[str] = None,
153
- sample_size: Optional[int] = None,
154
- all_varchar: Optional[bool] = None,
155
- normalize_names: Optional[bool] = None,
156
- filename: Optional[bool] = None,
157
- null_padding: Optional[bool] = None,
158
- ) -> DuckDBPyRelation: ...
159
- def from_df(self, df: pandas.DataFrame = ...) -> DuckDBPyRelation: ...
160
- @overload
161
- def read_parquet(self, file_glob: str, binary_as_string: bool = ..., *, file_row_number: bool = ..., filename: bool = ..., hive_partitioning: bool = ..., union_by_name: bool = ...) -> DuckDBPyRelation: ...
162
- @overload
163
- def read_parquet(self, file_globs: List[str], binary_as_string: bool = ..., *, file_row_number: bool = ..., filename: bool = ..., hive_partitioning: bool = ..., union_by_name: bool = ...) -> DuckDBPyRelation: ...
164
- @overload
165
- def from_parquet(self, file_glob: str, binary_as_string: bool = ..., *, file_row_number: bool = ..., filename: bool = ..., hive_partitioning: bool = ..., union_by_name: bool = ...) -> DuckDBPyRelation: ...
166
- @overload
167
- def from_parquet(self, file_globs: List[str], binary_as_string: bool = ..., *, file_row_number: bool = ..., filename: bool = ..., hive_partitioning: bool = ..., union_by_name: bool = ...) -> DuckDBPyRelation: ...
168
- def from_substrait(self, proto: bytes) -> DuckDBPyRelation: ...
169
- def get_substrait(self, query: str) -> DuckDBPyRelation: ...
170
- def get_substrait_json(self, query: str) -> DuckDBPyRelation: ...
171
- def from_substrait_json(self, json: str) -> DuckDBPyRelation: ...
172
- def get_table_names(self, query: str) -> Set[str]: ...
173
- def install_extension(self, *args, **kwargs) -> None: ...
174
- def interrupt(self) -> None: ...
175
- def list_filesystems(self) -> list: ...
176
- def filesystem_is_registered(self, name: str) -> bool: ...
177
- def load_extension(self, extension: str) -> None: ...
178
- def pl(self, rows_per_batch: int = ..., connection: DuckDBPyConnection = ...) -> polars.DataFrame: ...
179
- def torch(self, connection: DuckDBPyConnection = ...) -> dict: ...
180
- def tf(self, connection: DuckDBPyConnection = ...) -> dict: ...
181
-
182
- def from_query(self, query: str, **kwargs) -> DuckDBPyRelation: ...
183
- def query(self, query: str, **kwargs) -> DuckDBPyRelation: ...
184
- def sql(self, query: str, **kwargs) -> DuckDBPyRelation: ...
185
-
186
- def register(self, view_name: str, python_object: object) -> DuckDBPyConnection: ...
187
- def remove_function(self, name: str) -> DuckDBPyConnection: ...
188
- def create_function(
189
- self,
190
- name: str,
191
- func: Callable,
192
- args: Optional[List[DuckDBPyType]],
193
- return_type: Optional[DuckDBPyType],
194
- vectorized: Optional[bool] = False,
195
- null_handling: Optional[FunctionNullHandling] = FunctionNullHandling.DEFAULT,
196
- exception_handling: Optional[PythonExceptionHandling] = PythonExceptionHandling.DEFAULT,
197
- side_effects: Optional[bool] = False) -> DuckDBPyConnection: ...
198
- def register_filesystem(self, filesystem: fsspec.AbstractFileSystem) -> None: ...
199
- def rollback(self) -> DuckDBPyConnection: ...
200
- def table(self, table_name: str) -> DuckDBPyRelation: ...
201
- def table_function(self, name: str, parameters: object = ...) -> DuckDBPyRelation: ...
202
- def unregister(self, view_name: str) -> DuckDBPyConnection: ...
203
- def unregister_filesystem(self, name: str) -> None: ...
204
- def values(self, values: object) -> DuckDBPyRelation: ...
205
- def view(self, view_name: str) -> DuckDBPyRelation: ...
206
- def sqltype(self, type_str: str) -> DuckDBPyType: ...
207
- def dtype(self, type_str: str) -> DuckDBPyType: ...
208
- def type(self, type_str: str) -> DuckDBPyType: ...
209
- def struct_type(self, fields: Union[Dict[str, DuckDBPyType], List[str]]) -> DuckDBPyType: ...
210
- def row_type(self, fields: Union[Dict[str, DuckDBPyType], List[str]]) -> DuckDBPyType: ...
211
- def union_type(self, members: Union[Dict[str, DuckDBPyType], List[str]]) -> DuckDBPyType: ...
212
- def string_type(self, collation: str = "") -> DuckDBPyType: ...
213
- def enum_type(self, name: str, type: DuckDBPyType, values: list) -> DuckDBPyType: ...
214
- def decimal_type(self, width: int, scale: int) -> DuckDBPyType: ...
215
- def array_type(self, type: DuckDBPyType) -> DuckDBPyType: ...
216
- def list_type(self, type: DuckDBPyType) -> DuckDBPyType: ...
217
- def map_type(self, key: DuckDBPyType, value: DuckDBPyType) -> DuckDBPyType: ...
218
- def __enter__(self) -> DuckDBPyConnection: ...
219
- def __exit__(self, exc_type: object, exc: object, traceback: object) -> None: ...
220
- @property
221
- def description(self) -> Optional[list]: ...
222
-
223
- class DuckDBPyRelation:
224
- def close(self) -> None: ...
225
- def __getattr__(self, name: str) -> DuckDBPyRelation: ...
226
- def __getitem__(self, name: str) -> DuckDBPyRelation: ...
227
- def __init__(self, *args, **kwargs) -> None: ...
228
- def abs(self, aggregation_columns: str) -> DuckDBPyRelation: ...
229
- def aggregate(self, aggr_expr: str, group_expr: str = ...) -> DuckDBPyRelation: ...
230
- def apply(self, function_name: str, function_aggr: str, group_expr: str = ..., function_parameter: str = ..., projected_columns: str = ...) -> DuckDBPyRelation: ...
231
- def arrow(self, batch_size: int = ...) -> pyarrow.lib.Table: ...
232
- def count(self, count_aggr: str, group_expr: str = ...) -> DuckDBPyRelation: ...
233
- def create(self, table_name: str) -> None: ...
234
- def to_table(self, table_name: str) -> None: ...
235
- def create_view(self, view_name: str, replace: bool = ...) -> DuckDBPyRelation: ...
236
- def to_view(self, view_name: str, replace: bool = ...) -> DuckDBPyRelation: ...
237
- def cummax(self, aggregation_columns: str) -> DuckDBPyRelation: ...
238
- def cummin(self, aggregation_columns: str) -> DuckDBPyRelation: ...
239
- def cumprod(self, aggregation_columns: str) -> DuckDBPyRelation: ...
240
- def cumsum(self, aggregation_columns: str) -> DuckDBPyRelation: ...
241
- def describe(self) -> DuckDBPyRelation: ...
242
- def sql_query(self) -> str: ...
243
- def df(self, *args, **kwargs) -> pandas.DataFrame: ...
244
- def distinct(self) -> DuckDBPyRelation: ...
245
- def except_(self, other_rel: DuckDBPyRelation) -> DuckDBPyRelation: ...
246
- def execute(self, *args, **kwargs) -> DuckDBPyRelation: ...
247
- def explain(self, type: Optional[Literal['standard', 'analyze'] | int] = 'standard') -> str: ...
248
- def fetchall(self) -> list: ...
249
- def fetchmany(self, size: int = ...) -> list: ...
250
- def fetchnumpy(self) -> dict: ...
251
- def fetchone(self) -> Optional[tuple]: ...
252
- def fetchdf(self, *args, **kwargs) -> Any: ...
253
- def fetch_arrow_table(self, rows_per_batch: int = ...) -> pyarrow.lib.Table: ...
254
- def filter(self, filter_expr: str) -> DuckDBPyRelation: ...
255
- def insert(self, values: object) -> None: ...
256
- def insert_into(self, table_name: str) -> None: ...
257
- def intersect(self, other_rel: DuckDBPyRelation) -> DuckDBPyRelation: ...
258
- def join(self, other_rel: DuckDBPyRelation, condition: str, how: str = ...) -> DuckDBPyRelation: ...
259
- def kurt(self, aggregation_columns: str, group_columns: str = ...) -> DuckDBPyRelation: ...
260
- def limit(self, n: int, offset: int = ...) -> DuckDBPyRelation: ...
261
- def mad(self, aggregation_columns: str, group_columns: str = ...) -> DuckDBPyRelation: ...
262
- def map(self, map_function: function, schema: Optional[Dict[str, DuckDBPyType]]) -> DuckDBPyRelation: ...
263
- def max(self, max_aggr: str, group_expr: str = ...) -> DuckDBPyRelation: ...
264
- def mean(self, mean_aggr: str, group_expr: str = ...) -> DuckDBPyRelation: ...
265
- def median(self, median_aggr: str, group_expr: str = ...) -> DuckDBPyRelation: ...
266
- def min(self, min_aggr: str, group_expr: str = ...) -> DuckDBPyRelation: ...
267
- def mode(self, aggregation_columns: str, group_columns: str = ...) -> DuckDBPyRelation: ...
268
- def order(self, order_expr: str) -> DuckDBPyRelation: ...
269
- def pl(self, rows_per_batch: int = ..., connection: DuckDBPyConnection = ...) -> polars.DataFrame: ...
270
- def torch(self, connection: DuckDBPyConnection = ...) -> dict: ...
271
- def tf(self, connection: DuckDBPyConnection = ...) -> dict: ...
272
- def prod(self, aggregation_columns: str, group_columns: str = ...) -> DuckDBPyRelation: ...
273
- def project(self, project_expr: str) -> DuckDBPyRelation: ...
274
- def select_types(self, types: List[Union[str, DuckDBPyType]]) -> DuckDBPyRelation: ...
275
- def select_dtypes(self, types: List[Union[str, DuckDBPyType]]) -> DuckDBPyRelation: ...
276
- def quantile(self, q: str, quantile_aggr: str, group_expr: str = ...) -> DuckDBPyRelation: ...
277
- def query(self, virtual_table_name: str, sql_query: str) -> DuckDBPyRelation: ...
278
- def record_batch(self, batch_size: int = ...) -> pyarrow.lib.RecordBatchReader: ...
279
- def fetch_arrow_reader(self, batch_size: int = ...) -> pyarrow.lib.RecordBatchReader: ...
280
- def sem(self, aggregation_columns: str, group_columns: str = ...) -> DuckDBPyRelation: ...
281
- def set_alias(self, alias: str) -> DuckDBPyRelation: ...
282
- def show(self) -> None: ...
283
- def skew(self, aggregation_columns: str, group_columns: str = ...) -> DuckDBPyRelation: ...
284
- def std(self, std_aggr: str, group_expr: str = ...) -> DuckDBPyRelation: ...
285
- def sum(self, sum_aggr: str, group_expr: str = ...) -> DuckDBPyRelation: ...
286
- def to_arrow_table(self, batch_size: int = ...) -> pyarrow.lib.Table: ...
287
- def to_df(self, *args, **kwargs) -> pandas.DataFrame: ...
288
- def union(self, union_rel: DuckDBPyRelation) -> DuckDBPyRelation: ...
289
- def unique(self, unique_aggr: str) -> DuckDBPyRelation: ...
290
- def value_counts(self, value_counts_aggr: str, group_expr: str = ...) -> DuckDBPyRelation: ...
291
- def var(self, var_aggr: str, group_expr: str = ...) -> DuckDBPyRelation: ...
292
- def to_parquet(
293
- self,
294
- file_name: str,
295
- compression: Optional[str]
296
- ) -> None: ...
297
- def write_parquet(
298
- self,
299
- file_name: str,
300
- compression: Optional[str]
301
- ) -> None: ...
302
- def to_csv(
303
- self,
304
- file_name: str,
305
- sep: Optional[str],
306
- na_rep: Optional[str],
307
- header: Optional[bool],
308
- quotechar: Optional[str],
309
- escapechar: Optional[str],
310
- date_format: Optional[str],
311
- timestamp_format: Optional[str],
312
- quoting: Optional[str | int],
313
- encoding: Optional[str],
314
- compression: Optional[str]
315
- ) -> None: ...
316
- def write_csv(
317
- self,
318
- file_name: str,
319
- sep: Optional[str],
320
- na_rep: Optional[str],
321
- header: Optional[bool],
322
- quotechar: Optional[str],
323
- escapechar: Optional[str],
324
- date_format: Optional[str],
325
- timestamp_format: Optional[str],
326
- quoting: Optional[str | int],
327
- encoding: Optional[str],
328
- compression: Optional[str]
329
- ) -> None: ...
330
- def __len__(self) -> int: ...
331
- @property
332
- def alias(self) -> str: ...
333
- @property
334
- def columns(self) -> list: ...
335
- @property
336
- def dtypes(self) -> List[DuckDBPyType]: ...
337
- @property
338
- def description(self) -> list: ...
339
- @property
340
- def shape(self) -> tuple: ...
341
- @property
342
- def type(self) -> str: ...
343
- @property
344
- def types(self) -> List[DuckDBPyType]: ...
345
-
346
- class Error(Exception): ...
347
-
348
- class FatalException(Error): ...
349
-
350
- class HTTPException(IOException):
351
- status_code: int
352
- body: str
353
- reason: str
354
- headers: Dict[str, str]
355
-
356
- class IOException(OperationalError): ...
357
-
358
- class IntegrityError(Error): ...
359
-
360
- class InternalError(Error): ...
361
-
362
- class InternalException(InternalError): ...
363
-
364
- class InterruptException(Error): ...
365
-
366
- class InvalidInputException(ProgrammingError): ...
367
-
368
- class InvalidTypeException(ProgrammingError): ...
369
-
370
- class NotImplementedException(NotSupportedError): ...
371
-
372
- class NotSupportedError(Error): ...
373
-
374
- class OperationalError(Error): ...
375
-
376
- class OutOfMemoryException(OperationalError): ...
377
-
378
- class OutOfRangeException(DataError): ...
379
-
380
- class ParserException(ProgrammingError): ...
381
-
382
- class PermissionException(Error): ...
383
-
384
- class ProgrammingError(Error): ...
385
-
386
- class SequenceException(Error): ...
387
-
388
- class SerializationException(OperationalError): ...
389
-
390
- class StandardException(Error): ...
391
-
392
- class SyntaxException(ProgrammingError): ...
393
-
394
- class TransactionException(OperationalError): ...
395
-
396
- class TypeMismatchException(DataError): ...
397
-
398
- class ValueOutOfRangeException(DataError): ...
399
-
400
- class Warning(Exception): ...
401
-
402
- class token_type:
403
- # stubgen override - these make mypy sad
404
- #__doc__: ClassVar[str] = ... # read-only
405
- #__members__: ClassVar[dict] = ... # read-only
406
- __entries: ClassVar[dict] = ...
407
- comment: ClassVar[token_type] = ...
408
- identifier: ClassVar[token_type] = ...
409
- keyword: ClassVar[token_type] = ...
410
- numeric_const: ClassVar[token_type] = ...
411
- operator: ClassVar[token_type] = ...
412
- string_const: ClassVar[token_type] = ...
413
- def __init__(self, value: int) -> None: ...
414
- def __eq__(self, other: object) -> bool: ...
415
- def __getstate__(self) -> int: ...
416
- def __hash__(self) -> int: ...
417
- # stubgen override - pybind only puts index in python >= 3.8: https://github.com/EricCousineau-TRI/pybind11/blob/54430436/include/pybind11/pybind11.h#L1789
418
- if sys.version_info >= (3, 7):
419
- def __index__(self) -> int: ...
420
- def __int__(self) -> int: ...
421
- def __ne__(self, other: object) -> bool: ...
422
- def __setstate__(self, state: int) -> None: ...
423
- @property
424
- def name(self) -> str: ...
425
- @property
426
- def value(self) -> int: ...
427
- @property
428
- # stubgen override - this gets removed by stubgen but it shouldn't
429
- def __members__(self) -> object: ...
430
-
431
- def aggregate(df: pandas.DataFrame, aggr_expr: str, group_expr: str = ..., connection: DuckDBPyConnection = ...) -> DuckDBPyRelation: ...
432
- def alias(df: pandas.DataFrame, alias: str, connection: DuckDBPyConnection = ...) -> DuckDBPyRelation: ...
433
- def connect(database: str = ..., read_only: bool = ..., config: dict = ...) -> DuckDBPyConnection: ...
434
- def distinct(df: pandas.DataFrame, connection: DuckDBPyConnection = ...) -> DuckDBPyRelation: ...
435
- def filter(df: pandas.DataFrame, filter_expr: str, connection: DuckDBPyConnection = ...) -> DuckDBPyRelation: ...
436
- def from_substrait_json(jsonm: str, connection: DuckDBPyConnection = ...) -> DuckDBPyRelation: ...
437
- def limit(df: pandas.DataFrame, n: int, connection: DuckDBPyConnection = ...) -> DuckDBPyRelation: ...
438
- def order(df: pandas.DataFrame, order_expr: str, connection: DuckDBPyConnection = ...) -> DuckDBPyRelation: ...
439
- def project(df: pandas.DataFrame, project_expr: str, connection: DuckDBPyConnection = ...) -> DuckDBPyRelation: ...
440
- def write_csv(df: pandas.DataFrame, file_name: str, connection: DuckDBPyConnection = ...) -> None: ...
441
- def read_json(
442
- file_name: str,
443
- columns: Optional[Dict[str,str]] = None,
444
- sample_size: Optional[int] = None,
445
- maximum_depth: Optional[int] = None,
446
- format: Optional[str] = None,
447
- records: Optional[str] = None,
448
- connection: DuckDBPyConnection = ...
449
- ) -> DuckDBPyRelation: ...
450
- def read_csv(
451
- path_or_buffer: Union[str, StringIO, TextIOBase],
452
- header: Optional[bool | int] = None,
453
- compression: Optional[str] = None,
454
- sep: Optional[str] = None,
455
- delimiter: Optional[str] = None,
456
- dtype: Optional[Dict[str, str] | List[str]] = None,
457
- na_values: Optional[str] = None,
458
- skiprows: Optional[int] = None,
459
- quotechar: Optional[str] = None,
460
- escapechar: Optional[str] = None,
461
- encoding: Optional[str] = None,
462
- parallel: Optional[bool] = None,
463
- date_format: Optional[str] = None,
464
- timestamp_format: Optional[str] = None,
465
- sample_size: Optional[int] = None,
466
- all_varchar: Optional[bool] = None,
467
- normalize_names: Optional[bool] = None,
468
- filename: Optional[bool] = None,
469
- connection: DuckDBPyConnection = ...
470
- ) -> DuckDBPyRelation: ...
471
- def from_csv_auto(
472
- name: str,
473
- header: Optional[bool | int] = None,
474
- compression: Optional[str] = None,
475
- sep: Optional[str] = None,
476
- delimiter: Optional[str] = None,
477
- dtype: Optional[Dict[str, str] | List[str]] = None,
478
- na_values: Optional[str] = None,
479
- skiprows: Optional[int] = None,
480
- quotechar: Optional[str] = None,
481
- escapechar: Optional[str] = None,
482
- encoding: Optional[str] = None,
483
- parallel: Optional[bool] = None,
484
- date_format: Optional[str] = None,
485
- timestamp_format: Optional[str] = None,
486
- sample_size: Optional[int] = None,
487
- all_varchar: Optional[bool] = None,
488
- normalize_names: Optional[bool] = None,
489
- filename: Optional[bool] = None,
490
- null_padding: Optional[bool] = None,
491
- connection: DuckDBPyConnection = ...
492
- ) -> DuckDBPyRelation: ...
493
-
494
- def append(table_name: str, df: pandas.DataFrame, connection: DuckDBPyConnection = ...) -> DuckDBPyConnection: ...
495
- def arrow(rows_per_batch: int = ..., connection: DuckDBPyConnection = ...) -> pyarrow.lib.Table: ...
496
- def begin(connection: DuckDBPyConnection = ...) -> DuckDBPyConnection: ...
497
- def close(connection: DuckDBPyConnection = ...) -> None: ...
498
- def commit(connection: DuckDBPyConnection = ...) -> DuckDBPyConnection: ...
499
- def cursor(connection: DuckDBPyConnection = ...) -> DuckDBPyConnection: ...
500
- def df(connection: DuckDBPyConnection = ...) -> pandas.DataFrame: ...
501
- def description(connection: DuckDBPyConnection = ...) -> Optional[list]: ...
502
- def duplicate(connection: DuckDBPyConnection = ...) -> DuckDBPyConnection: ...
503
- def execute(query: str, parameters: object = ..., multiple_parameter_sets: bool = ..., connection: DuckDBPyConnection = ...) -> DuckDBPyConnection: ...
504
- def executemany(query: str, parameters: object = ..., connection: DuckDBPyConnection = ...) -> DuckDBPyConnection: ...
505
- def fetch_arrow_table(rows_per_batch: int = ..., connection: DuckDBPyConnection = ...) -> pyarrow.lib.Table: ...
506
- def fetch_df(*args, connection: DuckDBPyConnection = ..., **kwargs) -> pandas.DataFrame: ...
507
- def fetch_df_chunk(*args, connection: DuckDBPyConnection = ..., **kwargs) -> pandas.DataFrame: ...
508
- def fetch_record_batch(rows_per_batch: int = ..., connection: DuckDBPyConnection = ...) -> pyarrow.lib.RecordBatchReader: ...
509
- def fetchall(connection: DuckDBPyConnection = ...) -> list: ...
510
- def fetchdf(*args, connection: DuckDBPyConnection = ..., **kwargs) -> pandas.DataFrame: ...
511
- def fetchmany(size: int = ..., connection: DuckDBPyConnection = ...) -> list: ...
512
- def fetchnumpy(connection: DuckDBPyConnection = ...) -> dict: ...
513
- def fetchone(connection: DuckDBPyConnection = ...) -> Optional[tuple]: ...
514
- def from_arrow(arrow_object: object, connection: DuckDBPyConnection = ...) -> DuckDBPyRelation: ...
515
- def from_df(df: pandas.DataFrame = ..., connection: DuckDBPyConnection = ...) -> DuckDBPyRelation: ...
516
- @overload
517
- def read_parquet(file_glob: str, binary_as_string: bool = ..., *, file_row_number: bool = ..., filename: bool = ..., hive_partitioning: bool = ..., union_by_name: bool = ..., connection: DuckDBPyConnection = ...) -> DuckDBPyRelation: ...
518
- @overload
519
- def read_parquet(file_globs: List[str], binary_as_string: bool = ..., *, file_row_number: bool = ..., filename: bool = ..., hive_partitioning: bool = ..., union_by_name: bool = ..., connection: DuckDBPyConnection = ...) -> DuckDBPyRelation: ...
520
- @overload
521
- def from_parquet(file_glob: str, binary_as_string: bool = ..., *, file_row_number: bool = ..., filename: bool = ..., hive_partitioning: bool = ..., union_by_name: bool = ..., connection: DuckDBPyConnection = ...) -> DuckDBPyRelation: ...
522
- @overload
523
- def from_parquet(file_globs: List[str], binary_as_string: bool = ..., *, file_row_number: bool = ..., filename: bool = ..., hive_partitioning: bool = ..., union_by_name: bool = ..., connection: DuckDBPyConnection = ...) -> DuckDBPyRelation: ...
524
- def from_substrait(proto: bytes, connection: DuckDBPyConnection = ...) -> DuckDBPyRelation: ...
525
- def get_substrait(query: str, connection: DuckDBPyConnection = ...) -> DuckDBPyRelation: ...
526
- def get_substrait_json(query: str, connection: DuckDBPyConnection = ...) -> DuckDBPyRelation: ...
527
- def get_table_names(query: str, connection: DuckDBPyConnection = ...) -> Set[str]: ...
528
- def install_extension(*args, connection: DuckDBPyConnection = ..., **kwargs) -> None: ...
529
- def interrupt(connection: DuckDBPyConnection = ...) -> None: ...
530
- def list_filesystems(connection: DuckDBPyConnection = ...) -> list: ...
531
- def filesystem_is_registered(name: str, connection: DuckDBPyConnection = ...) -> bool: ...
532
- def load_extension(extension: str, connection: DuckDBPyConnection = ...) -> None: ...
533
- def pl(rows_per_batch: int = ..., connection: DuckDBPyConnection = ...) -> polars.DataFrame: ...
534
- def torch(connection: DuckDBPyConnection = ...) -> dict: ...
535
- def tf(self, connection: DuckDBPyConnection = ...) -> dict: ...
536
- def register(view_name: str, python_object: object, connection: DuckDBPyConnection = ...) -> DuckDBPyConnection: ...
537
- def remove_function(name: str, connection : DuckDBPyConnection = ...) -> DuckDBPyConnection: ...
538
- def create_function(
539
- name: str,
540
- func: Callable,
541
- args: Optional[List[DuckDBPyType]],
542
- return_type: Optional[DuckDBPyType],
543
- vectorized: Optional[bool] = False,
544
- null_handling: Optional[FunctionNullHandling] = FunctionNullHandling.DEFAULT,
545
- exception_handling: Optional[PythonExceptionHandling] = PythonExceptionHandling.DEFAULT,
546
- side_effects: Optional[bool] = False,
547
- connection: DuckDBPyConnection = ...) -> DuckDBPyConnection: ...
548
- def register_filesystem(filesystem: fsspec.AbstractFileSystem, connection: DuckDBPyConnection = ...) -> None: ...
549
- def rollback(connection: DuckDBPyConnection = ...) -> DuckDBPyConnection: ...
550
-
551
- def query(query: str, connection: DuckDBPyConnection = ..., **kwargs) -> DuckDBPyRelation: ...
552
- def sql(query: str, connection: DuckDBPyConnection = ..., **kwargs) -> DuckDBPyRelation: ...
553
- def from_query(query: str, connection: DuckDBPyConnection = ..., **kwargs) -> DuckDBPyRelation: ...
554
-
555
- def table(table_name: str, connection: DuckDBPyConnection = ...) -> DuckDBPyRelation: ...
556
- def table_function(name: str, parameters: object = ..., connection: DuckDBPyConnection = ...) -> DuckDBPyRelation: ...
557
- def unregister(view_name: str, connection: DuckDBPyConnection = ...) -> DuckDBPyConnection: ...
558
- def query_df(df: pandas.DataFrame, virtual_table_name: str, sql_query: str, connection: DuckDBPyConnection = ...) -> DuckDBPyRelation: ...
559
- def unregister_filesystem(name: str, connection: DuckDBPyConnection = ...) -> None: ...
560
- def tokenize(query: str) -> list: ...
561
- def values(values: object, connection: DuckDBPyConnection = ...) -> DuckDBPyRelation: ...
562
- def view(view_name: str, connection: DuckDBPyConnection = ...) -> DuckDBPyRelation: ...
563
- def sqltype(type_str: str, connection: DuckDBPyConnection = ...) -> DuckDBPyType: ...
564
- def dtype(type_str: str, connection: DuckDBPyConnection = ...) -> DuckDBPyType: ...
565
- def type(type_str: str, connection: DuckDBPyConnection = ...) -> DuckDBPyType: ...
566
- def struct_type(fields: Union[Dict[str, DuckDBPyType], List[str]], connection: DuckDBPyConnection = ...) -> DuckDBPyType: ...
567
- def row_type(fields: Union[Dict[str, DuckDBPyType], List[str]], connection: DuckDBPyConnection = ...) -> DuckDBPyType: ...
568
- def union_type(members: Union[Dict[str, DuckDBPyType], List[str]], connection: DuckDBPyConnection = ...) -> DuckDBPyType: ...
569
- def string_type(collation: str = "", connection: DuckDBPyConnection = ...) -> DuckDBPyType: ...
570
- def enum_type(name: str, type: DuckDBPyType, values: list, connection: DuckDBPyConnection = ...) -> DuckDBPyType: ...
571
- def decimal_type(width: int, scale: int, connection: DuckDBPyConnection = ...) -> DuckDBPyType: ...
572
- def array_type(type: DuckDBPyType, connection: DuckDBPyConnection = ...) -> DuckDBPyType: ...
573
- def list_type(type: DuckDBPyType, connection: DuckDBPyConnection = ...) -> DuckDBPyType: ...
574
- def map_type(key: DuckDBPyType, value: DuckDBPyType, connection: DuckDBPyConnection = ...) -> DuckDBPyType: ...
@@ -1,33 +0,0 @@
1
- from .. import DuckDBPyConnection
2
-
3
- from typing import Dict
4
-
5
- SPECIAL: FunctionNullHandling
6
- DEFAULT: FunctionNullHandling
7
-
8
- NATIVE: PythonUDFType
9
- ARROW: PythonUDFType
10
-
11
- class FunctionNullHandling:
12
- DEFAULT: FunctionNullHandling
13
- SPECIAL: FunctionNullHandling
14
- def __int__(self) -> int: ...
15
- def __index__(self) -> int: ...
16
- @property
17
- def __members__(self) -> Dict[str, FunctionNullHandling]: ...
18
- @property
19
- def name(self) -> str: ...
20
- @property
21
- def value(self) -> int: ...
22
-
23
- class PythonUDFType:
24
- NATIVE: PythonUDFType
25
- ARROW: PythonUDFType
26
- def __int__(self) -> int: ...
27
- def __index__(self) -> int: ...
28
- @property
29
- def __members__(self) -> Dict[str, PythonUDFType]: ...
30
- @property
31
- def name(self) -> str: ...
32
- @property
33
- def value(self) -> int: ...
@@ -1,35 +0,0 @@
1
- from .. import DuckDBPyConnection
2
-
3
- SQLNULL: DuckDBPyType
4
- BOOLEAN: DuckDBPyType
5
- TINYINT: DuckDBPyType
6
- UTINYINT: DuckDBPyType
7
- SMALLINT: DuckDBPyType
8
- USMALLINT: DuckDBPyType
9
- INTEGER: DuckDBPyType
10
- UINTEGER: DuckDBPyType
11
- BIGINT: DuckDBPyType
12
- UBIGINT: DuckDBPyType
13
- HUGEINT: DuckDBPyType
14
- UUID: DuckDBPyType
15
- FLOAT: DuckDBPyType
16
- DOUBLE: DuckDBPyType
17
- DATE: DuckDBPyType
18
- TIMESTAMP: DuckDBPyType
19
- TIMESTAMP_MS: DuckDBPyType
20
- TIMESTAMP_NS: DuckDBPyType
21
- TIMESTAMP_S: DuckDBPyType
22
- TIME: DuckDBPyType
23
- TIME_TZ: DuckDBPyType
24
- TIMESTAMP_TZ: DuckDBPyType
25
- VARCHAR: DuckDBPyType
26
- BLOB: DuckDBPyType
27
- BIT: DuckDBPyType
28
- INTERVAL: DuckDBPyType
29
-
30
- class DuckDBPyType:
31
- def __init__(self, type_str: str, connection: DuckDBPyConnection = ...) -> None: ...
32
- def __repr__(self) -> str: ...
33
- def __eq__(self, other) -> bool: ...
34
- def __getattr__(self, name: str): DuckDBPyType
35
- def __getitem__(self, name: str): DuckDBPyType