fugue 0.9.0.dev4__py3-none-any.whl → 0.9.1__py3-none-any.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.
@@ -20,6 +20,7 @@ from triad.collections.function_wrapper import (
20
20
  PositionalParam,
21
21
  function_wrapper,
22
22
  )
23
+ from triad.utils.convert import compare_annotations
23
24
  from triad.utils.iter import EmptyAwareIterable, make_empty_aware
24
25
 
25
26
  from ..constants import FUGUE_ENTRYPOINT
@@ -37,6 +38,14 @@ from .iterable_dataframe import IterableDataFrame
37
38
  from .pandas_dataframe import PandasDataFrame
38
39
 
39
40
 
41
+ def _compare_iter(tp: Any) -> Any:
42
+ return lambda x: compare_annotations(
43
+ x, Iterable[tp] # type:ignore
44
+ ) or compare_annotations(
45
+ x, Iterator[tp] # type:ignore
46
+ )
47
+
48
+
40
49
  @function_wrapper(FUGUE_ENTRYPOINT)
41
50
  class DataFrameFunctionWrapper(FunctionWrapper):
42
51
  @property
@@ -228,10 +237,7 @@ class _ListListParam(_LocalNoSchemaDataFrameParam):
228
237
  return len(df)
229
238
 
230
239
 
231
- @fugue_annotated_param(
232
- Iterable[List[Any]],
233
- matcher=lambda x: x == Iterable[List[Any]] or x == Iterator[List[Any]],
234
- )
240
+ @fugue_annotated_param(Iterable[List[Any]], matcher=_compare_iter(List[Any]))
235
241
  class _IterableListParam(_LocalNoSchemaDataFrameParam):
236
242
  @no_type_check
237
243
  def to_input_data(self, df: DataFrame, ctx: Any) -> Iterable[List[Any]]:
@@ -288,10 +294,7 @@ class _ListDictParam(_LocalNoSchemaDataFrameParam):
288
294
  return len(df)
289
295
 
290
296
 
291
- @fugue_annotated_param(
292
- Iterable[Dict[str, Any]],
293
- matcher=lambda x: x == Iterable[Dict[str, Any]] or x == Iterator[Dict[str, Any]],
294
- )
297
+ @fugue_annotated_param(Iterable[Dict[str, Any]], matcher=_compare_iter(Dict[str, Any]))
295
298
  class _IterableDictParam(_LocalNoSchemaDataFrameParam):
296
299
  @no_type_check
297
300
  def to_input_data(self, df: DataFrame, ctx: Any) -> Iterable[Dict[str, Any]]:
@@ -360,10 +363,7 @@ class _PandasParam(LocalDataFrameParam):
360
363
  return "pandas"
361
364
 
362
365
 
363
- @fugue_annotated_param(
364
- Iterable[pd.DataFrame],
365
- matcher=lambda x: x == Iterable[pd.DataFrame] or x == Iterator[pd.DataFrame],
366
- )
366
+ @fugue_annotated_param(Iterable[pd.DataFrame], matcher=_compare_iter(pd.DataFrame))
367
367
  class _IterablePandasParam(LocalDataFrameParam):
368
368
  @no_type_check
369
369
  def to_input_data(self, df: DataFrame, ctx: Any) -> Iterable[pd.DataFrame]:
@@ -419,10 +419,7 @@ class _PyArrowTableParam(LocalDataFrameParam):
419
419
  return "pyarrow"
420
420
 
421
421
 
422
- @fugue_annotated_param(
423
- Iterable[pa.Table],
424
- matcher=lambda x: x == Iterable[pa.Table] or x == Iterator[pa.Table],
425
- )
422
+ @fugue_annotated_param(Iterable[pa.Table], matcher=_compare_iter(pa.Table))
426
423
  class _IterableArrowParam(LocalDataFrameParam):
427
424
  @no_type_check
428
425
  def to_input_data(self, df: DataFrame, ctx: Any) -> Iterable[pa.Table]:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: fugue
3
- Version: 0.9.0.dev4
3
+ Version: 0.9.1
4
4
  Summary: An abstraction layer for distributed computation
5
5
  Home-page: http://github.com/fugue-project/fugue
6
6
  Author: The Fugue Development Team
@@ -20,7 +20,7 @@ Classifier: Programming Language :: Python :: 3.11
20
20
  Classifier: Programming Language :: Python :: 3 :: Only
21
21
  Requires-Python: >=3.8
22
22
  Description-Content-Type: text/markdown
23
- Requires-Dist: triad >=0.9.6
23
+ Requires-Dist: triad >=0.9.7
24
24
  Requires-Dist: adagio >=0.2.4
25
25
  Provides-Extra: all
26
26
  Requires-Dist: qpd >=0.4.4 ; extra == 'all'
@@ -31,7 +31,7 @@ fugue/dataframe/arrow_dataframe.py,sha256=r5zcZBX_N6XO5dmixBkTCPgLcMmgDF022piZvr
31
31
  fugue/dataframe/dataframe.py,sha256=xmyG85i14A6LDRkNmPt29oYq7PJsq668s1QvFHK8PV4,16964
32
32
  fugue/dataframe/dataframe_iterable_dataframe.py,sha256=lx71KfaI4lsVKI-79buc-idaeT20JEMBOq21SQcAiY8,7259
33
33
  fugue/dataframe/dataframes.py,sha256=tBSpHsENgbcdOJ0Jgst6PTKbjG7_uoFJch96oTlaQIs,4160
34
- fugue/dataframe/function_wrapper.py,sha256=V1eQMOn27UroEYT7_YiwoEF0RjZYIM0zkD3vfaMAQFs,14813
34
+ fugue/dataframe/function_wrapper.py,sha256=hOZF3GmwpxqwqKi9-pEOAPZSW1ZFyB47hLxRrGyOiuM,14855
35
35
  fugue/dataframe/iterable_dataframe.py,sha256=TcOoNKa4jNbHbvAZ0XAhtMmGcioygIHPxI9budDtenQ,4758
36
36
  fugue/dataframe/pandas_dataframe.py,sha256=0L0wYCGhD2BpQbruoT07Ox9iQM5YLHLNrcgzudc-yKs,11633
37
37
  fugue/dataframe/utils.py,sha256=bA_otOJt9oju1yq5gtn21L_GDT_pUgNc6luYuBIhbUQ,10488
@@ -137,7 +137,7 @@ fugue_spark/tester.py,sha256=VX003yGNlBukaZTQSN-w7XvgSk4rqxrWQIzno0dWrXg,2481
137
137
  fugue_spark/_utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
138
138
  fugue_spark/_utils/convert.py,sha256=eRWkDYA4UO-FQu-2y4O80WEdawx7X_rIrWg55AlOiRc,10007
139
139
  fugue_spark/_utils/io.py,sha256=OdUezKpB29Lx9aUS2k9x0xUAGZrmgMZyQYGPEeHk7rQ,5574
140
- fugue_spark/_utils/misc.py,sha256=o8dZmXOHnA7D_ps37vgGXTPTiSEG9LQzPKq7l-MG-qM,860
140
+ fugue_spark/_utils/misc.py,sha256=9LsbBp6nOEhqXFLr8oWTc3VKzKk-vuVyixlRoquGnEs,858
141
141
  fugue_spark/_utils/partition.py,sha256=iaesyO5f4uXhj1W-p91cD5ecPiGlu0bzh8gl2ce2Uvg,3618
142
142
  fugue_sql/__init__.py,sha256=Cmr7w0Efr7PzoXdQzdJfc4Dgqd69qKqcHZZodENq7EU,287
143
143
  fugue_sql/exceptions.py,sha256=ltS0MC8gMnVVrJbQiOZ0kRUWvVQ2LTx33dCW3ugqtb0,260
@@ -147,10 +147,10 @@ fugue_test/builtin_suite.py,sha256=cOkZG6w1RHhWWxtjQhZClZQaGT6haNd576BoUmNC_cA,7
147
147
  fugue_test/dataframe_suite.py,sha256=7ym4sshDUly6004cq1UlppqDVtbwxD6CKxR4Lu70i0s,18994
148
148
  fugue_test/execution_suite.py,sha256=jcSSoKqTGbeWzTxkyYU-8i2zJAjzuXn7BqE8ul-JjIc,48646
149
149
  fugue_test/fixtures.py,sha256=8Pev-mxRZOWwTFlsGjcSZ0iIs78zyWbp5tq4KG1wyvk,1432
150
- fugue_version/__init__.py,sha256=H9NWRZb7NbeRRPLP_V1fARmLNXranorVM-OOY-8_2ug,22
151
- fugue-0.9.0.dev4.dist-info/LICENSE,sha256=z8d0m5b2O9McPEK1xHG_dWgUBT6EfBDz6wA0F7xSPTA,11358
152
- fugue-0.9.0.dev4.dist-info/METADATA,sha256=smbI6QuuMajmoMhJ14Y4MUs2mGpb4onc6kImR83D9DQ,18385
153
- fugue-0.9.0.dev4.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
154
- fugue-0.9.0.dev4.dist-info/entry_points.txt,sha256=kiRuUkKOnnHFvlWpYSfVUZiXJW3hOez6gjYoOhGht3Q,302
155
- fugue-0.9.0.dev4.dist-info/top_level.txt,sha256=y1eCfzGdQ1_RkgcShcfbvXs-bopD3DwJcIOxP9EFXno,140
156
- fugue-0.9.0.dev4.dist-info/RECORD,,
150
+ fugue_version/__init__.py,sha256=UwJXM8JY2T3tE2id0K2k_lEaVThbRTrGO1mNibyzIz8,22
151
+ fugue-0.9.1.dist-info/LICENSE,sha256=z8d0m5b2O9McPEK1xHG_dWgUBT6EfBDz6wA0F7xSPTA,11358
152
+ fugue-0.9.1.dist-info/METADATA,sha256=zu44QGPIwk28QyKe9H4Si2ANByy1sJ9cmauNrhCg4bc,18380
153
+ fugue-0.9.1.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
154
+ fugue-0.9.1.dist-info/entry_points.txt,sha256=kiRuUkKOnnHFvlWpYSfVUZiXJW3hOez6gjYoOhGht3Q,302
155
+ fugue-0.9.1.dist-info/top_level.txt,sha256=y1eCfzGdQ1_RkgcShcfbvXs-bopD3DwJcIOxP9EFXno,140
156
+ fugue-0.9.1.dist-info/RECORD,,
@@ -3,7 +3,7 @@ from typing import Any
3
3
  try:
4
4
  from pyspark.sql.connect.session import SparkSession as SparkConnectSession
5
5
  from pyspark.sql.connect.dataframe import DataFrame as SparkConnectDataFrame
6
- except ImportError: # pragma: no cover
6
+ except Exception: # pragma: no cover
7
7
  SparkConnectSession = None
8
8
  SparkConnectDataFrame = None
9
9
  import pyspark.sql as ps
fugue_version/__init__.py CHANGED
@@ -1 +1 @@
1
- __version__ = "0.9.0"
1
+ __version__ = "0.9.1"