pyspark-connect 4.0.0.dev1__tar.gz

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 (317) hide show
  1. pyspark_connect-4.0.0.dev1/MANIFEST.in +31 -0
  2. pyspark_connect-4.0.0.dev1/PKG-INFO +59 -0
  3. pyspark_connect-4.0.0.dev1/README.md +33 -0
  4. pyspark_connect-4.0.0.dev1/pyspark/__init__.py +156 -0
  5. pyspark_connect-4.0.0.dev1/pyspark/_globals.py +71 -0
  6. pyspark_connect-4.0.0.dev1/pyspark/_typing.pyi +43 -0
  7. pyspark_connect-4.0.0.dev1/pyspark/accumulators.py +345 -0
  8. pyspark_connect-4.0.0.dev1/pyspark/cloudpickle/__init__.py +18 -0
  9. pyspark_connect-4.0.0.dev1/pyspark/cloudpickle/cloudpickle.py +1487 -0
  10. pyspark_connect-4.0.0.dev1/pyspark/cloudpickle/cloudpickle_fast.py +13 -0
  11. pyspark_connect-4.0.0.dev1/pyspark/cloudpickle/compat.py +18 -0
  12. pyspark_connect-4.0.0.dev1/pyspark/conf.py +282 -0
  13. pyspark_connect-4.0.0.dev1/pyspark/daemon.py +225 -0
  14. pyspark_connect-4.0.0.dev1/pyspark/errors/__init__.py +88 -0
  15. pyspark_connect-4.0.0.dev1/pyspark/errors/error-conditions.json +1161 -0
  16. pyspark_connect-4.0.0.dev1/pyspark/errors/error_classes.py +31 -0
  17. pyspark_connect-4.0.0.dev1/pyspark/errors/exceptions/__init__.py +32 -0
  18. pyspark_connect-4.0.0.dev1/pyspark/errors/exceptions/base.py +395 -0
  19. pyspark_connect-4.0.0.dev1/pyspark/errors/exceptions/captured.py +421 -0
  20. pyspark_connect-4.0.0.dev1/pyspark/errors/exceptions/connect.py +464 -0
  21. pyspark_connect-4.0.0.dev1/pyspark/errors/utils.py +210 -0
  22. pyspark_connect-4.0.0.dev1/pyspark/errors_doc_gen.py +62 -0
  23. pyspark_connect-4.0.0.dev1/pyspark/find_spark_home.py +95 -0
  24. pyspark_connect-4.0.0.dev1/pyspark/install.py +203 -0
  25. pyspark_connect-4.0.0.dev1/pyspark/instrumentation_utils.py +187 -0
  26. pyspark_connect-4.0.0.dev1/pyspark/java_gateway.py +192 -0
  27. pyspark_connect-4.0.0.dev1/pyspark/join.py +119 -0
  28. pyspark_connect-4.0.0.dev1/pyspark/loose_version.py +75 -0
  29. pyspark_connect-4.0.0.dev1/pyspark/ml/__init__.py +71 -0
  30. pyspark_connect-4.0.0.dev1/pyspark/ml/_typing.pyi +84 -0
  31. pyspark_connect-4.0.0.dev1/pyspark/ml/base.py +412 -0
  32. pyspark_connect-4.0.0.dev1/pyspark/ml/classification.py +4337 -0
  33. pyspark_connect-4.0.0.dev1/pyspark/ml/clustering.py +2188 -0
  34. pyspark_connect-4.0.0.dev1/pyspark/ml/common.py +163 -0
  35. pyspark_connect-4.0.0.dev1/pyspark/ml/connect/__init__.py +46 -0
  36. pyspark_connect-4.0.0.dev1/pyspark/ml/connect/base.py +345 -0
  37. pyspark_connect-4.0.0.dev1/pyspark/ml/connect/classification.py +392 -0
  38. pyspark_connect-4.0.0.dev1/pyspark/ml/connect/evaluation.py +291 -0
  39. pyspark_connect-4.0.0.dev1/pyspark/ml/connect/feature.py +411 -0
  40. pyspark_connect-4.0.0.dev1/pyspark/ml/connect/functions.py +33 -0
  41. pyspark_connect-4.0.0.dev1/pyspark/ml/connect/io_utils.py +334 -0
  42. pyspark_connect-4.0.0.dev1/pyspark/ml/connect/pipeline.py +263 -0
  43. pyspark_connect-4.0.0.dev1/pyspark/ml/connect/summarizer.py +121 -0
  44. pyspark_connect-4.0.0.dev1/pyspark/ml/connect/tuning.py +577 -0
  45. pyspark_connect-4.0.0.dev1/pyspark/ml/connect/util.py +175 -0
  46. pyspark_connect-4.0.0.dev1/pyspark/ml/deepspeed/__init__.py +16 -0
  47. pyspark_connect-4.0.0.dev1/pyspark/ml/deepspeed/deepspeed_distributor.py +164 -0
  48. pyspark_connect-4.0.0.dev1/pyspark/ml/dl_util.py +150 -0
  49. pyspark_connect-4.0.0.dev1/pyspark/ml/evaluation.py +1165 -0
  50. pyspark_connect-4.0.0.dev1/pyspark/ml/feature.py +7480 -0
  51. pyspark_connect-4.0.0.dev1/pyspark/ml/fpm.py +543 -0
  52. pyspark_connect-4.0.0.dev1/pyspark/ml/functions.py +868 -0
  53. pyspark_connect-4.0.0.dev1/pyspark/ml/image.py +267 -0
  54. pyspark_connect-4.0.0.dev1/pyspark/ml/linalg/__init__.py +1379 -0
  55. pyspark_connect-4.0.0.dev1/pyspark/ml/model_cache.py +55 -0
  56. pyspark_connect-4.0.0.dev1/pyspark/ml/param/__init__.py +604 -0
  57. pyspark_connect-4.0.0.dev1/pyspark/ml/param/_shared_params_code_gen.py +375 -0
  58. pyspark_connect-4.0.0.dev1/pyspark/ml/param/shared.py +900 -0
  59. pyspark_connect-4.0.0.dev1/pyspark/ml/pipeline.py +454 -0
  60. pyspark_connect-4.0.0.dev1/pyspark/ml/recommendation.py +748 -0
  61. pyspark_connect-4.0.0.dev1/pyspark/ml/regression.py +3333 -0
  62. pyspark_connect-4.0.0.dev1/pyspark/ml/stat.py +530 -0
  63. pyspark_connect-4.0.0.dev1/pyspark/ml/torch/__init__.py +16 -0
  64. pyspark_connect-4.0.0.dev1/pyspark/ml/torch/data.py +102 -0
  65. pyspark_connect-4.0.0.dev1/pyspark/ml/torch/distributor.py +1094 -0
  66. pyspark_connect-4.0.0.dev1/pyspark/ml/torch/log_communication.py +198 -0
  67. pyspark_connect-4.0.0.dev1/pyspark/ml/torch/torch_run_process_wrapper.py +83 -0
  68. pyspark_connect-4.0.0.dev1/pyspark/ml/tree.py +434 -0
  69. pyspark_connect-4.0.0.dev1/pyspark/ml/tuning.py +1750 -0
  70. pyspark_connect-4.0.0.dev1/pyspark/ml/util.py +749 -0
  71. pyspark_connect-4.0.0.dev1/pyspark/ml/wrapper.py +478 -0
  72. pyspark_connect-4.0.0.dev1/pyspark/mllib/__init__.py +44 -0
  73. pyspark_connect-4.0.0.dev1/pyspark/mllib/_typing.pyi +33 -0
  74. pyspark_connect-4.0.0.dev1/pyspark/mllib/classification.py +989 -0
  75. pyspark_connect-4.0.0.dev1/pyspark/mllib/clustering.py +1318 -0
  76. pyspark_connect-4.0.0.dev1/pyspark/mllib/common.py +174 -0
  77. pyspark_connect-4.0.0.dev1/pyspark/mllib/evaluation.py +690 -0
  78. pyspark_connect-4.0.0.dev1/pyspark/mllib/feature.py +1084 -0
  79. pyspark_connect-4.0.0.dev1/pyspark/mllib/fpm.py +233 -0
  80. pyspark_connect-4.0.0.dev1/pyspark/mllib/linalg/__init__.py +1650 -0
  81. pyspark_connect-4.0.0.dev1/pyspark/mllib/linalg/distributed.py +1662 -0
  82. pyspark_connect-4.0.0.dev1/pyspark/mllib/random.py +698 -0
  83. pyspark_connect-4.0.0.dev1/pyspark/mllib/recommendation.py +389 -0
  84. pyspark_connect-4.0.0.dev1/pyspark/mllib/regression.py +1067 -0
  85. pyspark_connect-4.0.0.dev1/pyspark/mllib/stat/KernelDensity.py +59 -0
  86. pyspark_connect-4.0.0.dev1/pyspark/mllib/stat/__init__.py +34 -0
  87. pyspark_connect-4.0.0.dev1/pyspark/mllib/stat/_statistics.py +409 -0
  88. pyspark_connect-4.0.0.dev1/pyspark/mllib/stat/distribution.py +39 -0
  89. pyspark_connect-4.0.0.dev1/pyspark/mllib/stat/test.py +86 -0
  90. pyspark_connect-4.0.0.dev1/pyspark/mllib/tree.py +888 -0
  91. pyspark_connect-4.0.0.dev1/pyspark/mllib/util.py +660 -0
  92. pyspark_connect-4.0.0.dev1/pyspark/pandas/__init__.py +154 -0
  93. pyspark_connect-4.0.0.dev1/pyspark/pandas/_typing.py +52 -0
  94. pyspark_connect-4.0.0.dev1/pyspark/pandas/accessors.py +988 -0
  95. pyspark_connect-4.0.0.dev1/pyspark/pandas/base.py +1715 -0
  96. pyspark_connect-4.0.0.dev1/pyspark/pandas/categorical.py +798 -0
  97. pyspark_connect-4.0.0.dev1/pyspark/pandas/config.py +547 -0
  98. pyspark_connect-4.0.0.dev1/pyspark/pandas/correlation.py +261 -0
  99. pyspark_connect-4.0.0.dev1/pyspark/pandas/data_type_ops/__init__.py +16 -0
  100. pyspark_connect-4.0.0.dev1/pyspark/pandas/data_type_ops/base.py +522 -0
  101. pyspark_connect-4.0.0.dev1/pyspark/pandas/data_type_ops/binary_ops.py +98 -0
  102. pyspark_connect-4.0.0.dev1/pyspark/pandas/data_type_ops/boolean_ops.py +426 -0
  103. pyspark_connect-4.0.0.dev1/pyspark/pandas/data_type_ops/categorical_ops.py +141 -0
  104. pyspark_connect-4.0.0.dev1/pyspark/pandas/data_type_ops/complex_ops.py +145 -0
  105. pyspark_connect-4.0.0.dev1/pyspark/pandas/data_type_ops/date_ops.py +126 -0
  106. pyspark_connect-4.0.0.dev1/pyspark/pandas/data_type_ops/datetime_ops.py +171 -0
  107. pyspark_connect-4.0.0.dev1/pyspark/pandas/data_type_ops/null_ops.py +83 -0
  108. pyspark_connect-4.0.0.dev1/pyspark/pandas/data_type_ops/num_ops.py +591 -0
  109. pyspark_connect-4.0.0.dev1/pyspark/pandas/data_type_ops/string_ops.py +154 -0
  110. pyspark_connect-4.0.0.dev1/pyspark/pandas/data_type_ops/timedelta_ops.py +101 -0
  111. pyspark_connect-4.0.0.dev1/pyspark/pandas/data_type_ops/udt_ops.py +29 -0
  112. pyspark_connect-4.0.0.dev1/pyspark/pandas/datetimes.py +925 -0
  113. pyspark_connect-4.0.0.dev1/pyspark/pandas/exceptions.py +140 -0
  114. pyspark_connect-4.0.0.dev1/pyspark/pandas/extensions.py +388 -0
  115. pyspark_connect-4.0.0.dev1/pyspark/pandas/frame.py +13827 -0
  116. pyspark_connect-4.0.0.dev1/pyspark/pandas/generic.py +3649 -0
  117. pyspark_connect-4.0.0.dev1/pyspark/pandas/groupby.py +4620 -0
  118. pyspark_connect-4.0.0.dev1/pyspark/pandas/indexes/__init__.py +20 -0
  119. pyspark_connect-4.0.0.dev1/pyspark/pandas/indexes/base.py +2669 -0
  120. pyspark_connect-4.0.0.dev1/pyspark/pandas/indexes/category.py +668 -0
  121. pyspark_connect-4.0.0.dev1/pyspark/pandas/indexes/datetimes.py +882 -0
  122. pyspark_connect-4.0.0.dev1/pyspark/pandas/indexes/multi.py +1291 -0
  123. pyspark_connect-4.0.0.dev1/pyspark/pandas/indexes/timedelta.py +205 -0
  124. pyspark_connect-4.0.0.dev1/pyspark/pandas/indexing.py +1865 -0
  125. pyspark_connect-4.0.0.dev1/pyspark/pandas/internal.py +1664 -0
  126. pyspark_connect-4.0.0.dev1/pyspark/pandas/missing/__init__.py +48 -0
  127. pyspark_connect-4.0.0.dev1/pyspark/pandas/missing/common.py +76 -0
  128. pyspark_connect-4.0.0.dev1/pyspark/pandas/missing/frame.py +62 -0
  129. pyspark_connect-4.0.0.dev1/pyspark/pandas/missing/general_functions.py +43 -0
  130. pyspark_connect-4.0.0.dev1/pyspark/pandas/missing/groupby.py +92 -0
  131. pyspark_connect-4.0.0.dev1/pyspark/pandas/missing/indexes.py +184 -0
  132. pyspark_connect-4.0.0.dev1/pyspark/pandas/missing/resample.py +101 -0
  133. pyspark_connect-4.0.0.dev1/pyspark/pandas/missing/scalars.py +29 -0
  134. pyspark_connect-4.0.0.dev1/pyspark/pandas/missing/series.py +68 -0
  135. pyspark_connect-4.0.0.dev1/pyspark/pandas/missing/window.py +168 -0
  136. pyspark_connect-4.0.0.dev1/pyspark/pandas/mlflow.py +236 -0
  137. pyspark_connect-4.0.0.dev1/pyspark/pandas/namespace.py +3771 -0
  138. pyspark_connect-4.0.0.dev1/pyspark/pandas/numpy_compat.py +259 -0
  139. pyspark_connect-4.0.0.dev1/pyspark/pandas/plot/__init__.py +17 -0
  140. pyspark_connect-4.0.0.dev1/pyspark/pandas/plot/core.py +1215 -0
  141. pyspark_connect-4.0.0.dev1/pyspark/pandas/plot/matplotlib.py +976 -0
  142. pyspark_connect-4.0.0.dev1/pyspark/pandas/plot/plotly.py +261 -0
  143. pyspark_connect-4.0.0.dev1/pyspark/pandas/resample.py +804 -0
  144. pyspark_connect-4.0.0.dev1/pyspark/pandas/series.py +7356 -0
  145. pyspark_connect-4.0.0.dev1/pyspark/pandas/spark/__init__.py +16 -0
  146. pyspark_connect-4.0.0.dev1/pyspark/pandas/spark/accessors.py +1278 -0
  147. pyspark_connect-4.0.0.dev1/pyspark/pandas/spark/functions.py +173 -0
  148. pyspark_connect-4.0.0.dev1/pyspark/pandas/spark/utils.py +202 -0
  149. pyspark_connect-4.0.0.dev1/pyspark/pandas/sql_formatter.py +335 -0
  150. pyspark_connect-4.0.0.dev1/pyspark/pandas/sql_processor.py +390 -0
  151. pyspark_connect-4.0.0.dev1/pyspark/pandas/strings.py +2365 -0
  152. pyspark_connect-4.0.0.dev1/pyspark/pandas/supported_api_gen.py +439 -0
  153. pyspark_connect-4.0.0.dev1/pyspark/pandas/testing.py +328 -0
  154. pyspark_connect-4.0.0.dev1/pyspark/pandas/typedef/__init__.py +18 -0
  155. pyspark_connect-4.0.0.dev1/pyspark/pandas/typedef/typehints.py +877 -0
  156. pyspark_connect-4.0.0.dev1/pyspark/pandas/usage_logging/__init__.py +140 -0
  157. pyspark_connect-4.0.0.dev1/pyspark/pandas/usage_logging/usage_logger.py +132 -0
  158. pyspark_connect-4.0.0.dev1/pyspark/pandas/utils.py +1082 -0
  159. pyspark_connect-4.0.0.dev1/pyspark/pandas/window.py +2704 -0
  160. pyspark_connect-4.0.0.dev1/pyspark/profiler.py +526 -0
  161. pyspark_connect-4.0.0.dev1/pyspark/py.typed +1 -0
  162. pyspark_connect-4.0.0.dev1/pyspark/rddsampler.py +115 -0
  163. pyspark_connect-4.0.0.dev1/pyspark/resource/__init__.py +38 -0
  164. pyspark_connect-4.0.0.dev1/pyspark/resource/information.py +69 -0
  165. pyspark_connect-4.0.0.dev1/pyspark/resource/profile.py +342 -0
  166. pyspark_connect-4.0.0.dev1/pyspark/resource/requests.py +550 -0
  167. pyspark_connect-4.0.0.dev1/pyspark/resultiterable.py +45 -0
  168. pyspark_connect-4.0.0.dev1/pyspark/serializers.py +682 -0
  169. pyspark_connect-4.0.0.dev1/pyspark/shell.py +142 -0
  170. pyspark_connect-4.0.0.dev1/pyspark/shuffle.py +854 -0
  171. pyspark_connect-4.0.0.dev1/pyspark/sql/__init__.py +78 -0
  172. pyspark_connect-4.0.0.dev1/pyspark/sql/_typing.pyi +86 -0
  173. pyspark_connect-4.0.0.dev1/pyspark/sql/avro/__init__.py +18 -0
  174. pyspark_connect-4.0.0.dev1/pyspark/sql/avro/functions.py +224 -0
  175. pyspark_connect-4.0.0.dev1/pyspark/sql/catalog.py +1266 -0
  176. pyspark_connect-4.0.0.dev1/pyspark/sql/column.py +1557 -0
  177. pyspark_connect-4.0.0.dev1/pyspark/sql/conf.py +175 -0
  178. pyspark_connect-4.0.0.dev1/pyspark/sql/connect/__init__.py +18 -0
  179. pyspark_connect-4.0.0.dev1/pyspark/sql/connect/_typing.py +92 -0
  180. pyspark_connect-4.0.0.dev1/pyspark/sql/connect/avro/__init__.py +18 -0
  181. pyspark_connect-4.0.0.dev1/pyspark/sql/connect/avro/functions.py +139 -0
  182. pyspark_connect-4.0.0.dev1/pyspark/sql/connect/catalog.py +364 -0
  183. pyspark_connect-4.0.0.dev1/pyspark/sql/connect/client/__init__.py +23 -0
  184. pyspark_connect-4.0.0.dev1/pyspark/sql/connect/client/artifact.py +444 -0
  185. pyspark_connect-4.0.0.dev1/pyspark/sql/connect/client/core.py +1859 -0
  186. pyspark_connect-4.0.0.dev1/pyspark/sql/connect/client/logging.py +60 -0
  187. pyspark_connect-4.0.0.dev1/pyspark/sql/connect/client/reattach.py +322 -0
  188. pyspark_connect-4.0.0.dev1/pyspark/sql/connect/client/retries.py +317 -0
  189. pyspark_connect-4.0.0.dev1/pyspark/sql/connect/column.py +606 -0
  190. pyspark_connect-4.0.0.dev1/pyspark/sql/connect/conf.py +153 -0
  191. pyspark_connect-4.0.0.dev1/pyspark/sql/connect/conversion.py +584 -0
  192. pyspark_connect-4.0.0.dev1/pyspark/sql/connect/dataframe.py +2234 -0
  193. pyspark_connect-4.0.0.dev1/pyspark/sql/connect/datasource.py +47 -0
  194. pyspark_connect-4.0.0.dev1/pyspark/sql/connect/expressions.py +1121 -0
  195. pyspark_connect-4.0.0.dev1/pyspark/sql/connect/functions/__init__.py +21 -0
  196. pyspark_connect-4.0.0.dev1/pyspark/sql/connect/functions/builtin.py +4164 -0
  197. pyspark_connect-4.0.0.dev1/pyspark/sql/connect/functions/partitioning.py +112 -0
  198. pyspark_connect-4.0.0.dev1/pyspark/sql/connect/group.py +484 -0
  199. pyspark_connect-4.0.0.dev1/pyspark/sql/connect/observation.py +113 -0
  200. pyspark_connect-4.0.0.dev1/pyspark/sql/connect/plan.py +2472 -0
  201. pyspark_connect-4.0.0.dev1/pyspark/sql/connect/profiler.py +41 -0
  202. pyspark_connect-4.0.0.dev1/pyspark/sql/connect/proto/__init__.py +25 -0
  203. pyspark_connect-4.0.0.dev1/pyspark/sql/connect/proto/base_pb2.py +230 -0
  204. pyspark_connect-4.0.0.dev1/pyspark/sql/connect/proto/base_pb2.pyi +3736 -0
  205. pyspark_connect-4.0.0.dev1/pyspark/sql/connect/proto/base_pb2_grpc.py +517 -0
  206. pyspark_connect-4.0.0.dev1/pyspark/sql/connect/proto/catalog_pb2.py +110 -0
  207. pyspark_connect-4.0.0.dev1/pyspark/sql/connect/proto/catalog_pb2.pyi +1133 -0
  208. pyspark_connect-4.0.0.dev1/pyspark/sql/connect/proto/commands_pb2.py +172 -0
  209. pyspark_connect-4.0.0.dev1/pyspark/sql/connect/proto/commands_pb2.pyi +2199 -0
  210. pyspark_connect-4.0.0.dev1/pyspark/sql/connect/proto/common_pb2.py +62 -0
  211. pyspark_connect-4.0.0.dev1/pyspark/sql/connect/proto/common_pb2.pyi +298 -0
  212. pyspark_connect-4.0.0.dev1/pyspark/sql/connect/proto/example_plugins_pb2.py +54 -0
  213. pyspark_connect-4.0.0.dev1/pyspark/sql/connect/proto/example_plugins_pb2.pyi +112 -0
  214. pyspark_connect-4.0.0.dev1/pyspark/sql/connect/proto/expressions_pb2.py +112 -0
  215. pyspark_connect-4.0.0.dev1/pyspark/sql/connect/proto/expressions_pb2.pyi +1621 -0
  216. pyspark_connect-4.0.0.dev1/pyspark/sql/connect/proto/relations_pb2.py +218 -0
  217. pyspark_connect-4.0.0.dev1/pyspark/sql/connect/proto/relations_pb2.pyi +4006 -0
  218. pyspark_connect-4.0.0.dev1/pyspark/sql/connect/proto/types_pb2.py +98 -0
  219. pyspark_connect-4.0.0.dev1/pyspark/sql/connect/proto/types_pb2.pyi +1015 -0
  220. pyspark_connect-4.0.0.dev1/pyspark/sql/connect/protobuf/__init__.py +18 -0
  221. pyspark_connect-4.0.0.dev1/pyspark/sql/connect/protobuf/functions.py +165 -0
  222. pyspark_connect-4.0.0.dev1/pyspark/sql/connect/readwriter.py +965 -0
  223. pyspark_connect-4.0.0.dev1/pyspark/sql/connect/resource/__init__.py +16 -0
  224. pyspark_connect-4.0.0.dev1/pyspark/sql/connect/resource/profile.py +69 -0
  225. pyspark_connect-4.0.0.dev1/pyspark/sql/connect/session.py +1137 -0
  226. pyspark_connect-4.0.0.dev1/pyspark/sql/connect/shell/__init__.py +26 -0
  227. pyspark_connect-4.0.0.dev1/pyspark/sql/connect/shell/progress.py +212 -0
  228. pyspark_connect-4.0.0.dev1/pyspark/sql/connect/sql_formatter.py +76 -0
  229. pyspark_connect-4.0.0.dev1/pyspark/sql/connect/streaming/__init__.py +16 -0
  230. pyspark_connect-4.0.0.dev1/pyspark/sql/connect/streaming/query.py +463 -0
  231. pyspark_connect-4.0.0.dev1/pyspark/sql/connect/streaming/readwriter.py +692 -0
  232. pyspark_connect-4.0.0.dev1/pyspark/sql/connect/streaming/worker/__init__.py +18 -0
  233. pyspark_connect-4.0.0.dev1/pyspark/sql/connect/streaming/worker/foreach_batch_worker.py +101 -0
  234. pyspark_connect-4.0.0.dev1/pyspark/sql/connect/streaming/worker/listener_worker.py +115 -0
  235. pyspark_connect-4.0.0.dev1/pyspark/sql/connect/types.py +379 -0
  236. pyspark_connect-4.0.0.dev1/pyspark/sql/connect/udf.py +319 -0
  237. pyspark_connect-4.0.0.dev1/pyspark/sql/connect/udtf.py +209 -0
  238. pyspark_connect-4.0.0.dev1/pyspark/sql/connect/utils.py +100 -0
  239. pyspark_connect-4.0.0.dev1/pyspark/sql/connect/window.py +265 -0
  240. pyspark_connect-4.0.0.dev1/pyspark/sql/context.py +805 -0
  241. pyspark_connect-4.0.0.dev1/pyspark/sql/dataframe.py +6425 -0
  242. pyspark_connect-4.0.0.dev1/pyspark/sql/datasource.py +815 -0
  243. pyspark_connect-4.0.0.dev1/pyspark/sql/datasource_internal.py +146 -0
  244. pyspark_connect-4.0.0.dev1/pyspark/sql/functions/__init__.py +21 -0
  245. pyspark_connect-4.0.0.dev1/pyspark/sql/functions/builtin.py +21284 -0
  246. pyspark_connect-4.0.0.dev1/pyspark/sql/functions/partitioning.py +250 -0
  247. pyspark_connect-4.0.0.dev1/pyspark/sql/group.py +549 -0
  248. pyspark_connect-4.0.0.dev1/pyspark/sql/observation.py +172 -0
  249. pyspark_connect-4.0.0.dev1/pyspark/sql/pandas/__init__.py +21 -0
  250. pyspark_connect-4.0.0.dev1/pyspark/sql/pandas/_typing/__init__.pyi +355 -0
  251. pyspark_connect-4.0.0.dev1/pyspark/sql/pandas/_typing/protocols/__init__.pyi +17 -0
  252. pyspark_connect-4.0.0.dev1/pyspark/sql/pandas/_typing/protocols/frame.pyi +20 -0
  253. pyspark_connect-4.0.0.dev1/pyspark/sql/pandas/_typing/protocols/series.pyi +20 -0
  254. pyspark_connect-4.0.0.dev1/pyspark/sql/pandas/conversion.py +736 -0
  255. pyspark_connect-4.0.0.dev1/pyspark/sql/pandas/functions.py +543 -0
  256. pyspark_connect-4.0.0.dev1/pyspark/sql/pandas/functions.pyi +132 -0
  257. pyspark_connect-4.0.0.dev1/pyspark/sql/pandas/group_ops.py +750 -0
  258. pyspark_connect-4.0.0.dev1/pyspark/sql/pandas/map_ops.py +127 -0
  259. pyspark_connect-4.0.0.dev1/pyspark/sql/pandas/serializers.py +1118 -0
  260. pyspark_connect-4.0.0.dev1/pyspark/sql/pandas/typehints.py +178 -0
  261. pyspark_connect-4.0.0.dev1/pyspark/sql/pandas/types.py +1095 -0
  262. pyspark_connect-4.0.0.dev1/pyspark/sql/pandas/utils.py +96 -0
  263. pyspark_connect-4.0.0.dev1/pyspark/sql/profiler.py +390 -0
  264. pyspark_connect-4.0.0.dev1/pyspark/sql/protobuf/__init__.py +18 -0
  265. pyspark_connect-4.0.0.dev1/pyspark/sql/protobuf/functions.py +336 -0
  266. pyspark_connect-4.0.0.dev1/pyspark/sql/readwriter.py +2497 -0
  267. pyspark_connect-4.0.0.dev1/pyspark/sql/session.py +2295 -0
  268. pyspark_connect-4.0.0.dev1/pyspark/sql/sql_formatter.py +85 -0
  269. pyspark_connect-4.0.0.dev1/pyspark/sql/streaming/__init__.py +21 -0
  270. pyspark_connect-4.0.0.dev1/pyspark/sql/streaming/listener.py +1051 -0
  271. pyspark_connect-4.0.0.dev1/pyspark/sql/streaming/python_streaming_source_runner.py +218 -0
  272. pyspark_connect-4.0.0.dev1/pyspark/sql/streaming/query.py +748 -0
  273. pyspark_connect-4.0.0.dev1/pyspark/sql/streaming/readwriter.py +1765 -0
  274. pyspark_connect-4.0.0.dev1/pyspark/sql/streaming/state.py +297 -0
  275. pyspark_connect-4.0.0.dev1/pyspark/sql/types.py +3291 -0
  276. pyspark_connect-4.0.0.dev1/pyspark/sql/udf.py +791 -0
  277. pyspark_connect-4.0.0.dev1/pyspark/sql/udtf.py +501 -0
  278. pyspark_connect-4.0.0.dev1/pyspark/sql/utils.py +469 -0
  279. pyspark_connect-4.0.0.dev1/pyspark/sql/variant_utils.py +498 -0
  280. pyspark_connect-4.0.0.dev1/pyspark/sql/window.py +500 -0
  281. pyspark_connect-4.0.0.dev1/pyspark/sql/worker/__init__.py +16 -0
  282. pyspark_connect-4.0.0.dev1/pyspark/sql/worker/analyze_udtf.py +270 -0
  283. pyspark_connect-4.0.0.dev1/pyspark/sql/worker/commit_data_source_write.py +122 -0
  284. pyspark_connect-4.0.0.dev1/pyspark/sql/worker/create_data_source.py +192 -0
  285. pyspark_connect-4.0.0.dev1/pyspark/sql/worker/lookup_data_sources.py +100 -0
  286. pyspark_connect-4.0.0.dev1/pyspark/sql/worker/plan_data_source_read.py +320 -0
  287. pyspark_connect-4.0.0.dev1/pyspark/sql/worker/python_streaming_sink_runner.py +151 -0
  288. pyspark_connect-4.0.0.dev1/pyspark/sql/worker/write_into_data_source.py +234 -0
  289. pyspark_connect-4.0.0.dev1/pyspark/statcounter.py +165 -0
  290. pyspark_connect-4.0.0.dev1/pyspark/storagelevel.py +97 -0
  291. pyspark_connect-4.0.0.dev1/pyspark/streaming/__init__.py +22 -0
  292. pyspark_connect-4.0.0.dev1/pyspark/streaming/context.py +471 -0
  293. pyspark_connect-4.0.0.dev1/pyspark/streaming/dstream.py +931 -0
  294. pyspark_connect-4.0.0.dev1/pyspark/streaming/kinesis.py +205 -0
  295. pyspark_connect-4.0.0.dev1/pyspark/streaming/listener.py +83 -0
  296. pyspark_connect-4.0.0.dev1/pyspark/streaming/util.py +168 -0
  297. pyspark_connect-4.0.0.dev1/pyspark/taskcontext.py +506 -0
  298. pyspark_connect-4.0.0.dev1/pyspark/testing/__init__.py +19 -0
  299. pyspark_connect-4.0.0.dev1/pyspark/testing/connectutils.py +213 -0
  300. pyspark_connect-4.0.0.dev1/pyspark/testing/mllibutils.py +30 -0
  301. pyspark_connect-4.0.0.dev1/pyspark/testing/mlutils.py +279 -0
  302. pyspark_connect-4.0.0.dev1/pyspark/testing/pandasutils.py +645 -0
  303. pyspark_connect-4.0.0.dev1/pyspark/testing/sqlutils.py +272 -0
  304. pyspark_connect-4.0.0.dev1/pyspark/testing/streamingutils.py +177 -0
  305. pyspark_connect-4.0.0.dev1/pyspark/testing/utils.py +1021 -0
  306. pyspark_connect-4.0.0.dev1/pyspark/traceback_utils.py +81 -0
  307. pyspark_connect-4.0.0.dev1/pyspark/util.py +803 -0
  308. pyspark_connect-4.0.0.dev1/pyspark/version.py +1 -0
  309. pyspark_connect-4.0.0.dev1/pyspark/worker.py +1874 -0
  310. pyspark_connect-4.0.0.dev1/pyspark/worker_util.py +189 -0
  311. pyspark_connect-4.0.0.dev1/pyspark_connect.egg-info/PKG-INFO +59 -0
  312. pyspark_connect-4.0.0.dev1/pyspark_connect.egg-info/SOURCES.txt +316 -0
  313. pyspark_connect-4.0.0.dev1/pyspark_connect.egg-info/dependency_links.txt +1 -0
  314. pyspark_connect-4.0.0.dev1/pyspark_connect.egg-info/requires.txt +6 -0
  315. pyspark_connect-4.0.0.dev1/pyspark_connect.egg-info/top_level.txt +1 -0
  316. pyspark_connect-4.0.0.dev1/setup.cfg +10 -0
  317. pyspark_connect-4.0.0.dev1/setup.py +219 -0
@@ -0,0 +1,31 @@
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
+ # Reference: https://setuptools.pypa.io/en/latest/userguide/miscellaneous.html
18
+
19
+ recursive-include pyspark *.pyi py.typed *.json
20
+ recursive-include deps/jars *.jar
21
+ graft deps/bin
22
+ recursive-include deps/sbin spark-config.sh spark-daemon.sh start-history-server.sh stop-history-server.sh
23
+ recursive-include deps/data *.data *.txt
24
+ recursive-include deps/licenses *.txt
25
+ recursive-include deps/examples *.py
26
+ recursive-include lib *.zip
27
+ include README.md
28
+
29
+ # Note that these commands are processed in the order they appear, so keep
30
+ # this exclude at the end.
31
+ global-exclude *.py[cod] __pycache__ .DS_Store
@@ -0,0 +1,59 @@
1
+ Metadata-Version: 2.1
2
+ Name: pyspark-connect
3
+ Version: 4.0.0.dev1
4
+ Summary: Python Spark Connect client for Apache Spark
5
+ Home-page: https://github.com/apache/spark/tree/master/python
6
+ Author: Spark Developers
7
+ Author-email: dev@spark.apache.org
8
+ License: http://www.apache.org/licenses/LICENSE-2.0
9
+ Classifier: Development Status :: 5 - Production/Stable
10
+ Classifier: License :: OSI Approved :: Apache Software License
11
+ Classifier: Programming Language :: Python :: 3.9
12
+ Classifier: Programming Language :: Python :: 3.10
13
+ Classifier: Programming Language :: Python :: 3.11
14
+ Classifier: Programming Language :: Python :: 3.12
15
+ Classifier: Programming Language :: Python :: Implementation :: CPython
16
+ Classifier: Programming Language :: Python :: Implementation :: PyPy
17
+ Classifier: Typing :: Typed
18
+ Requires-Python: >=3.9
19
+ Description-Content-Type: text/markdown
20
+ Requires-Dist: pandas>=2.0.0
21
+ Requires-Dist: pyarrow>=10.0.0
22
+ Requires-Dist: grpcio>=1.59.3
23
+ Requires-Dist: grpcio-status>=1.59.3
24
+ Requires-Dist: googleapis-common-protos>=1.56.4
25
+ Requires-Dist: numpy>=1.21
26
+
27
+ # Apache Spark
28
+
29
+ Spark is a unified analytics engine for large-scale data processing. It provides
30
+ high-level APIs in Scala, Java, Python, and R, and an optimized engine that
31
+ supports general computation graphs for data analysis. It also supports a
32
+ rich set of higher-level tools including Spark SQL for SQL and DataFrames,
33
+ pandas API on Spark for pandas workloads, MLlib for machine learning, GraphX for graph processing,
34
+ and Structured Streaming for stream processing.
35
+
36
+ <https://spark.apache.org/>
37
+
38
+ ## Online Documentation
39
+
40
+ You can find the latest Spark documentation, including a programming
41
+ guide, on the [project web page](https://spark.apache.org/documentation.html)
42
+
43
+
44
+ ## Python Packaging
45
+
46
+ This README file only contains basic information related to pip installed PySpark.
47
+ This packaging is currently experimental and may change in future versions (although we will do our best to keep compatibility).
48
+ Using PySpark requires the Spark JARs, and if you are building this from source please see the builder instructions at
49
+ ["Building Spark"](https://spark.apache.org/docs/latest/building-spark.html).
50
+
51
+ The Python packaging for Spark is not intended to replace all of the other use cases. This Python packaged version of Spark is suitable for interacting with an existing cluster (be it Spark standalone, YARN) - but does not contain the tools required to set up your own standalone Spark cluster. You can download the full version of Spark from the [Apache Spark downloads page](https://spark.apache.org/downloads.html).
52
+
53
+
54
+ **NOTE:** If you are using this with a Spark standalone cluster you must ensure that the version (including minor version) matches or you may experience odd errors.
55
+
56
+ ## Python Requirements
57
+
58
+ At its core PySpark depends on Py4J, but some additional sub-packages have their own extra requirements for some features (including numpy, pandas, and pyarrow).
59
+ See also [Dependencies](https://spark.apache.org/docs/latest/api/python/getting_started/install.html#dependencies) for production, and [dev/requirements.txt](https://github.com/apache/spark/blob/master/dev/requirements.txt) for development.
@@ -0,0 +1,33 @@
1
+ # Apache Spark
2
+
3
+ Spark is a unified analytics engine for large-scale data processing. It provides
4
+ high-level APIs in Scala, Java, Python, and R, and an optimized engine that
5
+ supports general computation graphs for data analysis. It also supports a
6
+ rich set of higher-level tools including Spark SQL for SQL and DataFrames,
7
+ pandas API on Spark for pandas workloads, MLlib for machine learning, GraphX for graph processing,
8
+ and Structured Streaming for stream processing.
9
+
10
+ <https://spark.apache.org/>
11
+
12
+ ## Online Documentation
13
+
14
+ You can find the latest Spark documentation, including a programming
15
+ guide, on the [project web page](https://spark.apache.org/documentation.html)
16
+
17
+
18
+ ## Python Packaging
19
+
20
+ This README file only contains basic information related to pip installed PySpark.
21
+ This packaging is currently experimental and may change in future versions (although we will do our best to keep compatibility).
22
+ Using PySpark requires the Spark JARs, and if you are building this from source please see the builder instructions at
23
+ ["Building Spark"](https://spark.apache.org/docs/latest/building-spark.html).
24
+
25
+ The Python packaging for Spark is not intended to replace all of the other use cases. This Python packaged version of Spark is suitable for interacting with an existing cluster (be it Spark standalone, YARN) - but does not contain the tools required to set up your own standalone Spark cluster. You can download the full version of Spark from the [Apache Spark downloads page](https://spark.apache.org/downloads.html).
26
+
27
+
28
+ **NOTE:** If you are using this with a Spark standalone cluster you must ensure that the version (including minor version) matches or you may experience odd errors.
29
+
30
+ ## Python Requirements
31
+
32
+ At its core PySpark depends on Py4J, but some additional sub-packages have their own extra requirements for some features (including numpy, pandas, and pyarrow).
33
+ See also [Dependencies](https://spark.apache.org/docs/latest/api/python/getting_started/install.html#dependencies) for production, and [dev/requirements.txt](https://github.com/apache/spark/blob/master/dev/requirements.txt) for development.
@@ -0,0 +1,156 @@
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
+ """
19
+ PySpark is the Python API for Spark.
20
+
21
+ Public classes:
22
+
23
+ - :class:`SparkContext`:
24
+ Main entry point for Spark functionality.
25
+ - :class:`RDD`:
26
+ A Resilient Distributed Dataset (RDD), the basic abstraction in Spark.
27
+ - :class:`Broadcast`:
28
+ A broadcast variable that gets reused across tasks.
29
+ - :class:`Accumulator`:
30
+ An "add-only" shared variable that tasks can only add values to.
31
+ - :class:`SparkConf`:
32
+ For configuring Spark.
33
+ - :class:`SparkFiles`:
34
+ Access files shipped with jobs.
35
+ - :class:`StorageLevel`:
36
+ Finer-grained cache persistence levels.
37
+ - :class:`TaskContext`:
38
+ Information about the current running task, available on the workers and experimental.
39
+ - :class:`RDDBarrier`:
40
+ Wraps an RDD under a barrier stage for barrier execution.
41
+ - :class:`BarrierTaskContext`:
42
+ A :class:`TaskContext` that provides extra info and tooling for barrier execution.
43
+ - :class:`BarrierTaskInfo`:
44
+ Information about a barrier task.
45
+ - :class:`InheritableThread`:
46
+ A inheritable thread to use in Spark when the pinned thread mode is on.
47
+ """
48
+
49
+ import sys
50
+ from functools import wraps
51
+ from typing import cast, Any, Callable, TypeVar, Union
52
+
53
+ from pyspark.util import is_remote_only
54
+
55
+ if not is_remote_only():
56
+ from pyspark.core.rdd import RDD, RDDBarrier
57
+ from pyspark.core.files import SparkFiles
58
+ from pyspark.core.status import StatusTracker, SparkJobInfo, SparkStageInfo
59
+ from pyspark.core.broadcast import Broadcast
60
+ from pyspark.core import rdd, files, status, broadcast
61
+
62
+ # for backward compatibility references.
63
+ sys.modules["pyspark.rdd"] = rdd
64
+ sys.modules["pyspark.files"] = files
65
+ sys.modules["pyspark.status"] = status
66
+ sys.modules["pyspark.broadcast"] = broadcast
67
+
68
+ from pyspark.conf import SparkConf
69
+ from pyspark.util import InheritableThread, inheritable_thread_target
70
+ from pyspark.storagelevel import StorageLevel
71
+ from pyspark.accumulators import Accumulator, AccumulatorParam
72
+ from pyspark.serializers import MarshalSerializer, CPickleSerializer
73
+ from pyspark.taskcontext import TaskContext, BarrierTaskContext, BarrierTaskInfo
74
+ from pyspark.profiler import Profiler, BasicProfiler
75
+ from pyspark.version import __version__
76
+ from pyspark._globals import _NoValue # noqa: F401
77
+
78
+ _F = TypeVar("_F", bound=Callable)
79
+
80
+
81
+ def since(version: Union[str, float]) -> Callable[[_F], _F]:
82
+ """
83
+ A decorator that annotates a function to append the version of Spark the function was added.
84
+ """
85
+ import re
86
+
87
+ indent_p = re.compile(r"\n( +)")
88
+
89
+ def deco(f: _F) -> _F:
90
+ assert f.__doc__ is not None
91
+
92
+ indents = indent_p.findall(f.__doc__)
93
+ indent = " " * (min(len(m) for m in indents) if indents else 0)
94
+ f.__doc__ = f.__doc__.rstrip() + "\n\n%s.. versionadded:: %s" % (indent, version)
95
+ return f
96
+
97
+ return deco
98
+
99
+
100
+ def keyword_only(func: _F) -> _F:
101
+ """
102
+ A decorator that forces keyword arguments in the wrapped method
103
+ and saves actual input keyword arguments in `_input_kwargs`.
104
+
105
+ Notes
106
+ -----
107
+ Should only be used to wrap a method where first arg is `self`
108
+ """
109
+
110
+ @wraps(func)
111
+ def wrapper(self: Any, *args: Any, **kwargs: Any) -> Any:
112
+ if len(args) > 0:
113
+ raise TypeError("Method %s forces keyword arguments." % func.__name__)
114
+ self._input_kwargs = kwargs
115
+ return func(self, **kwargs)
116
+
117
+ return cast(_F, wrapper)
118
+
119
+
120
+ # To avoid circular dependencies
121
+ if not is_remote_only():
122
+ from pyspark.core.context import SparkContext
123
+ from pyspark.core import context
124
+
125
+ # for backward compatibility references.
126
+ sys.modules["pyspark.context"] = context
127
+
128
+ # for back compatibility
129
+ from pyspark.sql import SQLContext, HiveContext # noqa: F401
130
+
131
+ from pyspark.sql import Row # noqa: F401
132
+
133
+ __all__ = [
134
+ "SparkConf",
135
+ "SparkContext",
136
+ "SparkFiles",
137
+ "RDD",
138
+ "StorageLevel",
139
+ "Broadcast",
140
+ "Accumulator",
141
+ "AccumulatorParam",
142
+ "MarshalSerializer",
143
+ "CPickleSerializer",
144
+ "StatusTracker",
145
+ "SparkJobInfo",
146
+ "SparkStageInfo",
147
+ "Profiler",
148
+ "BasicProfiler",
149
+ "TaskContext",
150
+ "RDDBarrier",
151
+ "BarrierTaskContext",
152
+ "BarrierTaskInfo",
153
+ "InheritableThread",
154
+ "inheritable_thread_target",
155
+ "__version__",
156
+ ]
@@ -0,0 +1,71 @@
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
+ """
19
+ Module defining global singleton classes.
20
+
21
+ This module raises a RuntimeError if an attempt to reload it is made. In that
22
+ way the identities of the classes defined here are fixed and will remain so
23
+ even if pyspark itself is reloaded. In particular, a function like the following
24
+ will still work correctly after pyspark is reloaded:
25
+
26
+ def foo(arg=pyspark._NoValue):
27
+ if arg is pyspark._NoValue:
28
+ ...
29
+
30
+ See gh-7844 for a discussion of the reload problem that motivated this module.
31
+
32
+ Note that this approach is taken after from NumPy.
33
+ """
34
+
35
+ __ALL__ = ["_NoValue"]
36
+
37
+
38
+ # Disallow reloading this module so as to preserve the identities of the
39
+ # classes defined here.
40
+ if "_is_loaded" in globals():
41
+ raise RuntimeError("Reloading pyspark._globals is not allowed")
42
+ _is_loaded = True
43
+
44
+
45
+ class _NoValueType:
46
+ """Special keyword value.
47
+
48
+ The instance of this class may be used as the default value assigned to a
49
+ deprecated keyword in order to check if it has been given a user defined
50
+ value.
51
+
52
+ This class was copied from NumPy.
53
+ """
54
+
55
+ __instance = None
56
+
57
+ def __new__(cls):
58
+ # ensure that only one instance exists
59
+ if not cls.__instance:
60
+ cls.__instance = super(_NoValueType, cls).__new__(cls)
61
+ return cls.__instance
62
+
63
+ # needed for python 2 to preserve identity through a pickle
64
+ def __reduce__(self):
65
+ return (self.__class__, ())
66
+
67
+ def __repr__(self):
68
+ return "<no value>"
69
+
70
+
71
+ _NoValue = _NoValueType()
@@ -0,0 +1,43 @@
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 typing import Callable, Iterable, Sized, TypeVar, Union
20
+ from typing_extensions import Literal, Protocol
21
+
22
+ from numpy import int32, int64, float32, float64, ndarray
23
+
24
+ F = TypeVar("F", bound=Callable)
25
+ T_co = TypeVar("T_co", covariant=True)
26
+
27
+ PrimitiveType = Union[bool, float, int, str]
28
+
29
+ NonUDFType = Literal[0]
30
+
31
+ class SupportsIAdd(Protocol):
32
+ def __iadd__(self, other: SupportsIAdd) -> SupportsIAdd: ...
33
+
34
+ class SupportsOrdering(Protocol):
35
+ def __lt__(self, other: SupportsOrdering) -> bool: ...
36
+
37
+ class SizedIterable(Protocol, Sized, Iterable[T_co]): ...
38
+
39
+ S = TypeVar("S", bound=SupportsOrdering)
40
+
41
+ NumberOrArray = TypeVar(
42
+ "NumberOrArray", float, int, complex, int32, int64, float32, float64, ndarray
43
+ )