duckdb 1.5.0.dev86__cp314-cp314-macosx_10_15_universal2.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.

Files changed (52) hide show
  1. _duckdb-stubs/__init__.pyi +1443 -0
  2. _duckdb-stubs/_func.pyi +46 -0
  3. _duckdb-stubs/_sqltypes.pyi +75 -0
  4. _duckdb.cpython-314-darwin.so +0 -0
  5. adbc_driver_duckdb/__init__.py +50 -0
  6. adbc_driver_duckdb/dbapi.py +115 -0
  7. duckdb/__init__.py +381 -0
  8. duckdb/_dbapi_type_object.py +231 -0
  9. duckdb/_version.py +22 -0
  10. duckdb/bytes_io_wrapper.py +69 -0
  11. duckdb/experimental/__init__.py +3 -0
  12. duckdb/experimental/spark/LICENSE +260 -0
  13. duckdb/experimental/spark/__init__.py +6 -0
  14. duckdb/experimental/spark/_globals.py +77 -0
  15. duckdb/experimental/spark/_typing.py +46 -0
  16. duckdb/experimental/spark/conf.py +46 -0
  17. duckdb/experimental/spark/context.py +180 -0
  18. duckdb/experimental/spark/errors/__init__.py +70 -0
  19. duckdb/experimental/spark/errors/error_classes.py +918 -0
  20. duckdb/experimental/spark/errors/exceptions/__init__.py +16 -0
  21. duckdb/experimental/spark/errors/exceptions/base.py +168 -0
  22. duckdb/experimental/spark/errors/utils.py +111 -0
  23. duckdb/experimental/spark/exception.py +18 -0
  24. duckdb/experimental/spark/sql/__init__.py +7 -0
  25. duckdb/experimental/spark/sql/_typing.py +86 -0
  26. duckdb/experimental/spark/sql/catalog.py +79 -0
  27. duckdb/experimental/spark/sql/column.py +361 -0
  28. duckdb/experimental/spark/sql/conf.py +24 -0
  29. duckdb/experimental/spark/sql/dataframe.py +1389 -0
  30. duckdb/experimental/spark/sql/functions.py +6195 -0
  31. duckdb/experimental/spark/sql/group.py +424 -0
  32. duckdb/experimental/spark/sql/readwriter.py +435 -0
  33. duckdb/experimental/spark/sql/session.py +297 -0
  34. duckdb/experimental/spark/sql/streaming.py +36 -0
  35. duckdb/experimental/spark/sql/type_utils.py +107 -0
  36. duckdb/experimental/spark/sql/types.py +1239 -0
  37. duckdb/experimental/spark/sql/udf.py +37 -0
  38. duckdb/filesystem.py +33 -0
  39. duckdb/func/__init__.py +3 -0
  40. duckdb/functional/__init__.py +13 -0
  41. duckdb/polars_io.py +284 -0
  42. duckdb/py.typed +0 -0
  43. duckdb/query_graph/__main__.py +358 -0
  44. duckdb/sqltypes/__init__.py +63 -0
  45. duckdb/typing/__init__.py +71 -0
  46. duckdb/udf.py +24 -0
  47. duckdb/value/__init__.py +1 -0
  48. duckdb/value/constant/__init__.py +270 -0
  49. duckdb-1.5.0.dev86.dist-info/METADATA +88 -0
  50. duckdb-1.5.0.dev86.dist-info/RECORD +52 -0
  51. duckdb-1.5.0.dev86.dist-info/WHEEL +6 -0
  52. duckdb-1.5.0.dev86.dist-info/licenses/LICENSE +7 -0
@@ -0,0 +1,46 @@
1
+ #
2
+ # Licensed to the Apache Software Foundation (ASF) under one
3
+ # or more contributor license agreements. See the NOTICE file
4
+ # distributed with this work for additional information
5
+ # regarding copyright ownership. The ASF licenses this file
6
+ # to you under the Apache License, Version 2.0 (the
7
+ # "License"); you may not use this file except in compliance
8
+ # with the License. You may obtain a copy of the License at
9
+ #
10
+ # http://www.apache.org/licenses/LICENSE-2.0
11
+ #
12
+ # Unless required by applicable law or agreed to in writing,
13
+ # software distributed under the License is distributed on an
14
+ # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15
+ # KIND, either express or implied. See the License for the
16
+ # specific language governing permissions and limitations
17
+ # under the License.
18
+
19
+ from collections.abc import Iterable, Sized
20
+ from typing import Callable, TypeVar, Union
21
+
22
+ from numpy import float32, float64, int32, int64, ndarray
23
+ from typing_extensions import Literal, Protocol, Self
24
+
25
+ F = TypeVar("F", bound=Callable)
26
+ T_co = TypeVar("T_co", covariant=True)
27
+
28
+ PrimitiveType = Union[bool, float, int, str]
29
+
30
+ NonUDFType = Literal[0]
31
+
32
+
33
+ class SupportsIAdd(Protocol):
34
+ def __iadd__(self, other: "SupportsIAdd") -> Self: ...
35
+
36
+
37
+ class SupportsOrdering(Protocol):
38
+ def __lt__(self, other: "SupportsOrdering") -> bool: ...
39
+
40
+
41
+ class SizedIterable(Protocol, Sized, Iterable[T_co]): ...
42
+
43
+
44
+ S = TypeVar("S", bound=SupportsOrdering)
45
+
46
+ NumberOrArray = TypeVar("NumberOrArray", float, int, complex, int32, int64, float32, float64, ndarray)
@@ -0,0 +1,46 @@
1
+ from typing import Optional # noqa: D100
2
+
3
+ from duckdb.experimental.spark.exception import ContributionsAcceptedError
4
+
5
+
6
+ class SparkConf: # noqa: D101
7
+ def __init__(self) -> None: # noqa: D107
8
+ raise NotImplementedError
9
+
10
+ def contains(self, key: str) -> bool: # noqa: D102
11
+ raise ContributionsAcceptedError
12
+
13
+ def get(self, key: str, defaultValue: Optional[str] = None) -> Optional[str]: # noqa: D102
14
+ raise ContributionsAcceptedError
15
+
16
+ def getAll(self) -> list[tuple[str, str]]: # noqa: D102
17
+ raise ContributionsAcceptedError
18
+
19
+ def set(self, key: str, value: str) -> "SparkConf": # noqa: D102
20
+ raise ContributionsAcceptedError
21
+
22
+ def setAll(self, pairs: list[tuple[str, str]]) -> "SparkConf": # noqa: D102
23
+ raise ContributionsAcceptedError
24
+
25
+ def setAppName(self, value: str) -> "SparkConf": # noqa: D102
26
+ raise ContributionsAcceptedError
27
+
28
+ def setExecutorEnv( # noqa: D102
29
+ self, key: Optional[str] = None, value: Optional[str] = None, pairs: Optional[list[tuple[str, str]]] = None
30
+ ) -> "SparkConf":
31
+ raise ContributionsAcceptedError
32
+
33
+ def setIfMissing(self, key: str, value: str) -> "SparkConf": # noqa: D102
34
+ raise ContributionsAcceptedError
35
+
36
+ def setMaster(self, value: str) -> "SparkConf": # noqa: D102
37
+ raise ContributionsAcceptedError
38
+
39
+ def setSparkHome(self, value: str) -> "SparkConf": # noqa: D102
40
+ raise ContributionsAcceptedError
41
+
42
+ def toDebugString(self) -> str: # noqa: D102
43
+ raise ContributionsAcceptedError
44
+
45
+
46
+ __all__ = ["SparkConf"]
@@ -0,0 +1,180 @@
1
+ from typing import Optional # noqa: D100
2
+
3
+ import duckdb
4
+ from duckdb import DuckDBPyConnection
5
+ from duckdb.experimental.spark.conf import SparkConf
6
+ from duckdb.experimental.spark.exception import ContributionsAcceptedError
7
+
8
+
9
+ class SparkContext: # noqa: D101
10
+ def __init__(self, master: str) -> None: # noqa: D107
11
+ self._connection = duckdb.connect(":memory:")
12
+ # This aligns the null ordering with Spark.
13
+ self._connection.execute("set default_null_order='nulls_first_on_asc_last_on_desc'")
14
+
15
+ @property
16
+ def connection(self) -> DuckDBPyConnection: # noqa: D102
17
+ return self._connection
18
+
19
+ def stop(self) -> None: # noqa: D102
20
+ self._connection.close()
21
+
22
+ @classmethod
23
+ def getOrCreate(cls, conf: Optional[SparkConf] = None) -> "SparkContext": # noqa: D102
24
+ raise ContributionsAcceptedError
25
+
26
+ @classmethod
27
+ def setSystemProperty(cls, key: str, value: str) -> None: # noqa: D102
28
+ raise ContributionsAcceptedError
29
+
30
+ @property
31
+ def applicationId(self) -> str: # noqa: D102
32
+ raise ContributionsAcceptedError
33
+
34
+ @property
35
+ def defaultMinPartitions(self) -> int: # noqa: D102
36
+ raise ContributionsAcceptedError
37
+
38
+ @property
39
+ def defaultParallelism(self) -> int: # noqa: D102
40
+ raise ContributionsAcceptedError
41
+
42
+ # @property
43
+ # def resources(self) -> Dict[str, ResourceInformation]:
44
+ # raise ContributionsAcceptedError
45
+
46
+ @property
47
+ def startTime(self) -> str: # noqa: D102
48
+ raise ContributionsAcceptedError
49
+
50
+ @property
51
+ def uiWebUrl(self) -> str: # noqa: D102
52
+ raise ContributionsAcceptedError
53
+
54
+ @property
55
+ def version(self) -> str: # noqa: D102
56
+ raise ContributionsAcceptedError
57
+
58
+ def __repr__(self) -> str: # noqa: D105
59
+ raise ContributionsAcceptedError
60
+
61
+ # def accumulator(self, value: ~T, accum_param: Optional[ForwardRef('AccumulatorParam[T]')] = None
62
+ # ) -> 'Accumulator[T]':
63
+ # pass
64
+
65
+ def addArchive(self, path: str) -> None: # noqa: D102
66
+ raise ContributionsAcceptedError
67
+
68
+ def addFile(self, path: str, recursive: bool = False) -> None: # noqa: D102
69
+ raise ContributionsAcceptedError
70
+
71
+ def addPyFile(self, path: str) -> None: # noqa: D102
72
+ raise ContributionsAcceptedError
73
+
74
+ # def binaryFiles(self, path: str, minPartitions: Optional[int] = None
75
+ # ) -> duckdb.experimental.spark.rdd.RDD[typing.Tuple[str, bytes]]:
76
+ # pass
77
+
78
+ # def binaryRecords(self, path: str, recordLength: int) -> duckdb.experimental.spark.rdd.RDD[bytes]:
79
+ # pass
80
+
81
+ # def broadcast(self, value: ~T) -> 'Broadcast[T]':
82
+ # pass
83
+
84
+ def cancelAllJobs(self) -> None: # noqa: D102
85
+ raise ContributionsAcceptedError
86
+
87
+ def cancelJobGroup(self, groupId: str) -> None: # noqa: D102
88
+ raise ContributionsAcceptedError
89
+
90
+ def dump_profiles(self, path: str) -> None: # noqa: D102
91
+ raise ContributionsAcceptedError
92
+
93
+ # def emptyRDD(self) -> duckdb.experimental.spark.rdd.RDD[typing.Any]:
94
+ # pass
95
+
96
+ def getCheckpointDir(self) -> Optional[str]: # noqa: D102
97
+ raise ContributionsAcceptedError
98
+
99
+ def getConf(self) -> SparkConf: # noqa: D102
100
+ raise ContributionsAcceptedError
101
+
102
+ def getLocalProperty(self, key: str) -> Optional[str]: # noqa: D102
103
+ raise ContributionsAcceptedError
104
+
105
+ # def hadoopFile(self, path: str, inputFormatClass: str, keyClass: str, valueClass: str,
106
+ # keyConverter: Optional[str] = None, valueConverter: Optional[str] = None,
107
+ # conf: Optional[Dict[str, str]] = None, batchSize: int = 0) -> pyspark.rdd.RDD[typing.Tuple[~T, ~U]]:
108
+ # pass
109
+
110
+ # def hadoopRDD(self, inputFormatClass: str, keyClass: str, valueClass: str, keyConverter: Optional[str] = None,
111
+ # valueConverter: Optional[str] = None, conf: Optional[Dict[str, str]] = None, batchSize: int = 0
112
+ # ) -> pyspark.rdd.RDD[typing.Tuple[~T, ~U]]:
113
+ # pass
114
+
115
+ # def newAPIHadoopFile(self, path: str, inputFormatClass: str, keyClass: str, valueClass: str,
116
+ # keyConverter: Optional[str] = None, valueConverter: Optional[str] = None,
117
+ # conf: Optional[Dict[str, str]] = None, batchSize: int = 0) -> pyspark.rdd.RDD[typing.Tuple[~T, ~U]]:
118
+ # pass
119
+
120
+ # def newAPIHadoopRDD(self, inputFormatClass: str, keyClass: str, valueClass: str,
121
+ # keyConverter: Optional[str] = None, valueConverter: Optional[str] = None,
122
+ # conf: Optional[Dict[str, str]] = None, batchSize: int = 0) -> pyspark.rdd.RDD[typing.Tuple[~T, ~U]]:
123
+ # pass
124
+
125
+ # def parallelize(self, c: Iterable[~T], numSlices: Optional[int] = None) -> pyspark.rdd.RDD[~T]:
126
+ # pass
127
+
128
+ # def pickleFile(self, name: str, minPartitions: Optional[int] = None) -> pyspark.rdd.RDD[typing.Any]:
129
+ # pass
130
+
131
+ # def range(self, start: int, end: Optional[int] = None, step: int = 1, numSlices: Optional[int] = None
132
+ # ) -> pyspark.rdd.RDD[int]:
133
+ # pass
134
+
135
+ # def runJob(self, rdd: pyspark.rdd.RDD[~T], partitionFunc: Callable[[Iterable[~T]], Iterable[~U]],
136
+ # partitions: Optional[Sequence[int]] = None, allowLocal: bool = False) -> List[~U]:
137
+ # pass
138
+
139
+ # def sequenceFile(self, path: str, keyClass: Optional[str] = None, valueClass: Optional[str] = None,
140
+ # keyConverter: Optional[str] = None, valueConverter: Optional[str] = None, minSplits: Optional[int] = None,
141
+ # batchSize: int = 0) -> pyspark.rdd.RDD[typing.Tuple[~T, ~U]]:
142
+ # pass
143
+
144
+ def setCheckpointDir(self, dirName: str) -> None: # noqa: D102
145
+ raise ContributionsAcceptedError
146
+
147
+ def setJobDescription(self, value: str) -> None: # noqa: D102
148
+ raise ContributionsAcceptedError
149
+
150
+ def setJobGroup(self, groupId: str, description: str, interruptOnCancel: bool = False) -> None: # noqa: D102
151
+ raise ContributionsAcceptedError
152
+
153
+ def setLocalProperty(self, key: str, value: str) -> None: # noqa: D102
154
+ raise ContributionsAcceptedError
155
+
156
+ def setLogLevel(self, logLevel: str) -> None: # noqa: D102
157
+ raise ContributionsAcceptedError
158
+
159
+ def show_profiles(self) -> None: # noqa: D102
160
+ raise ContributionsAcceptedError
161
+
162
+ def sparkUser(self) -> str: # noqa: D102
163
+ raise ContributionsAcceptedError
164
+
165
+ # def statusTracker(self) -> duckdb.experimental.spark.status.StatusTracker:
166
+ # raise ContributionsAcceptedError
167
+
168
+ # def textFile(self, name: str, minPartitions: Optional[int] = None, use_unicode: bool = True
169
+ # ) -> pyspark.rdd.RDD[str]:
170
+ # pass
171
+
172
+ # def union(self, rdds: List[pyspark.rdd.RDD[~T]]) -> pyspark.rdd.RDD[~T]:
173
+ # pass
174
+
175
+ # def wholeTextFiles(self, path: str, minPartitions: Optional[int] = None, use_unicode: bool = True
176
+ # ) -> pyspark.rdd.RDD[typing.Tuple[str, str]]:
177
+ # pass
178
+
179
+
180
+ __all__ = ["SparkContext"]
@@ -0,0 +1,70 @@
1
+ #
2
+ # Licensed to the Apache Software Foundation (ASF) under one or more
3
+ # contributor license agreements. See the NOTICE file distributed with
4
+ # this work for additional information regarding copyright ownership.
5
+ # The ASF licenses this file to You under the Apache License, Version 2.0
6
+ # (the "License"); you may not use this file except in compliance with
7
+ # 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, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+ #
17
+
18
+ """PySpark exceptions."""
19
+
20
+ from .exceptions.base import (
21
+ AnalysisException,
22
+ ArithmeticException,
23
+ ArrayIndexOutOfBoundsException,
24
+ DateTimeException,
25
+ IllegalArgumentException,
26
+ NumberFormatException,
27
+ ParseException,
28
+ PySparkAssertionError,
29
+ PySparkAttributeError,
30
+ PySparkException,
31
+ PySparkIndexError,
32
+ PySparkNotImplementedError,
33
+ PySparkRuntimeError,
34
+ PySparkTypeError,
35
+ PySparkValueError,
36
+ PythonException,
37
+ QueryExecutionException,
38
+ SparkRuntimeException,
39
+ SparkUpgradeException,
40
+ StreamingQueryException,
41
+ TempTableAlreadyExistsException,
42
+ UnknownException,
43
+ UnsupportedOperationException,
44
+ )
45
+
46
+ __all__ = [
47
+ "AnalysisException",
48
+ "ArithmeticException",
49
+ "ArrayIndexOutOfBoundsException",
50
+ "DateTimeException",
51
+ "IllegalArgumentException",
52
+ "NumberFormatException",
53
+ "ParseException",
54
+ "PySparkAssertionError",
55
+ "PySparkAttributeError",
56
+ "PySparkException",
57
+ "PySparkIndexError",
58
+ "PySparkNotImplementedError",
59
+ "PySparkRuntimeError",
60
+ "PySparkTypeError",
61
+ "PySparkValueError",
62
+ "PythonException",
63
+ "QueryExecutionException",
64
+ "SparkRuntimeException",
65
+ "SparkUpgradeException",
66
+ "StreamingQueryException",
67
+ "TempTableAlreadyExistsException",
68
+ "UnknownException",
69
+ "UnsupportedOperationException",
70
+ ]