ygg 0.1.32__py3-none-any.whl → 0.1.33__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ygg
3
- Version: 0.1.32
3
+ Version: 0.1.33
4
4
  Summary: Type-friendly utilities for moving data between Python objects, Arrow, Polars, Pandas, Spark, and Databricks
5
5
  Author: Yggdrasil contributors
6
6
  License: Apache License
@@ -1,11 +1,11 @@
1
- ygg-0.1.32.dist-info/licenses/LICENSE,sha256=HrhfyXIkWY2tGFK11kg7vPCqhgh5DcxleloqdhrpyMY,11558
1
+ ygg-0.1.33.dist-info/licenses/LICENSE,sha256=HrhfyXIkWY2tGFK11kg7vPCqhgh5DcxleloqdhrpyMY,11558
2
2
  yggdrasil/__init__.py,sha256=PfH7Xwt6uue6oqe6S5V8NhDJcVQClkKrBE1KXhdelZc,117
3
- yggdrasil/version.py,sha256=lFBqLR0HmGJTF2s-4OaO-swIz8GxG2PdFo_uigEXczE,22
3
+ yggdrasil/version.py,sha256=-w_wSS_K7mBDaL2ciGoQ17Ab9V3-ElRGvc4UASK1hFI,22
4
4
  yggdrasil/databricks/__init__.py,sha256=skctY2c8W-hI81upx9F_PWRe5ishL3hrdiTuizgDjdw,152
5
5
  yggdrasil/databricks/compute/__init__.py,sha256=NvdzmaJSNYY1uJthv1hHdBuNu3bD_-Z65DWnaJt9yXg,289
6
- yggdrasil/databricks/compute/cluster.py,sha256=Z7rVqGcii0nIlGdkuDTPNCQ2StPJKTs96JN2Yj4fD8k,38005
6
+ yggdrasil/databricks/compute/cluster.py,sha256=PTA3OOl2s23NGrMHOCa4ues-cx6mb5p7LtsI0bl_oa8,38088
7
7
  yggdrasil/databricks/compute/execution_context.py,sha256=_PWn-Jjb-qRtI7HGm7IOUAKoIpmivNiBZTddxpZNBaM,22142
8
- yggdrasil/databricks/compute/remote.py,sha256=bBQnHjsyfEjRu9jt7Wnr0aJZGJZRdNk9bmPc0rIQZJc,2047
8
+ yggdrasil/databricks/compute/remote.py,sha256=735VSSkdGwIKXZ2F_SgiPiH-dUh7bheHBc4zaB6fDp8,2265
9
9
  yggdrasil/databricks/jobs/__init__.py,sha256=snxGSJb0M5I39v0y3IR-uEeSlZR248cQ_4DJ1sYs-h8,154
10
10
  yggdrasil/databricks/jobs/config.py,sha256=9LGeHD04hbfy0xt8_6oobC4moKJh4_DTjZiK4Q2Tqjk,11557
11
11
  yggdrasil/databricks/sql/__init__.py,sha256=y1n5yg-drZ8QVZbEgznsRG24kdJSnFis9l2YfYCsaCM,234
@@ -53,8 +53,8 @@ yggdrasil/types/cast/registry.py,sha256=_zdFGmUBB7P-e_LIcJlOxMcxAkXoA-UXB6HqLMgT
53
53
  yggdrasil/types/cast/spark_cast.py,sha256=_KAsl1DqmKMSfWxqhVE7gosjYdgiL1C5bDQv6eP3HtA,24926
54
54
  yggdrasil/types/cast/spark_pandas_cast.py,sha256=BuTiWrdCANZCdD_p2MAytqm74eq-rdRXd-LGojBRrfU,5023
55
55
  yggdrasil/types/cast/spark_polars_cast.py,sha256=btmZNHXn2NSt3fUuB4xg7coaE0RezIBdZD92H8NK0Jw,9073
56
- ygg-0.1.32.dist-info/METADATA,sha256=AV7sd29RvuL7SNA3Qixw_HUQK0gl5k9hGe0sym9i9OQ,19204
57
- ygg-0.1.32.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
58
- ygg-0.1.32.dist-info/entry_points.txt,sha256=6q-vpWG3kvw2dhctQ0LALdatoeefkN855Ev02I1dKGY,70
59
- ygg-0.1.32.dist-info/top_level.txt,sha256=iBe9Kk4VIVbLpgv_p8OZUIfxgj4dgJ5wBg6vO3rigso,10
60
- ygg-0.1.32.dist-info/RECORD,,
56
+ ygg-0.1.33.dist-info/METADATA,sha256=de-ntaFUDrFbT6rErjGnnZfPxN4DFBmxgokYLakRRcA,19204
57
+ ygg-0.1.33.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
58
+ ygg-0.1.33.dist-info/entry_points.txt,sha256=6q-vpWG3kvw2dhctQ0LALdatoeefkN855Ev02I1dKGY,70
59
+ ygg-0.1.33.dist-info/top_level.txt,sha256=iBe9Kk4VIVbLpgv_p8OZUIfxgj4dgJ5wBg6vO3rigso,10
60
+ ygg-0.1.33.dist-info/RECORD,,
@@ -848,6 +848,7 @@ class Cluster(WorkspaceService):
848
848
  env_variables: Optional[Dict[str, str]] = None,
849
849
  timeout: Optional[dt.timedelta] = None,
850
850
  result_tag: Optional[str] = None,
851
+ force_local: bool = False,
851
852
  **options
852
853
  ):
853
854
  """
@@ -873,13 +874,14 @@ class Cluster(WorkspaceService):
873
874
  env_variables: Optional environment variables to inject.
874
875
  timeout: Optional timeout for remote execution.
875
876
  result_tag: Optional tag for parsing remote output.
877
+ force_local: force local execution
876
878
  **options: Additional execution options passed through.
877
879
 
878
880
  Returns:
879
881
  A decorator or wrapped function that executes remotely.
880
882
  """
881
883
  def decorator(func: Callable):
882
- if os.getenv("DATABRICKS_RUNTIME_VERSION") is not None:
884
+ if force_local or self.is_in_databricks_environment():
883
885
  return func
884
886
 
885
887
  context = self.context(language=language or Language.PYTHON)
@@ -26,6 +26,7 @@ def databricks_remote_compute(
26
26
  cluster: Optional["Cluster"] = None,
27
27
  timeout: Optional[dt.timedelta] = None,
28
28
  env_keys: Optional[List[str]] = None,
29
+ force_local: bool = False,
29
30
  **options
30
31
  ) -> Callable[[Callable[..., ReturnType]], Callable[..., ReturnType]]:
31
32
  """Return a decorator that executes functions on a remote cluster.
@@ -37,11 +38,18 @@ def databricks_remote_compute(
37
38
  cluster: Pre-configured Cluster instance to reuse.
38
39
  timeout: Optional execution timeout for remote calls.
39
40
  env_keys: Optional environment variable names to forward.
41
+ force_local: Force local execution
40
42
  **options: Extra options forwarded to the execution decorator.
41
43
 
42
44
  Returns:
43
45
  A decorator that runs functions on the resolved Databricks cluster.
44
46
  """
47
+ if force_local or Workspace.is_in_databricks_environment():
48
+ def identity(x):
49
+ return x
50
+
51
+ return identity
52
+
45
53
  if isinstance(workspace, str):
46
54
  workspace = Workspace(host=workspace)
47
55
 
yggdrasil/version.py CHANGED
@@ -1 +1 @@
1
- __version__ = "0.1.32"
1
+ __version__ = "0.1.33"
File without changes