ygg 0.1.27__tar.gz → 0.1.29__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.
- {ygg-0.1.27 → ygg-0.1.29}/PKG-INFO +1 -1
- {ygg-0.1.27 → ygg-0.1.29}/pyproject.toml +2 -2
- {ygg-0.1.27 → ygg-0.1.29}/src/ygg.egg-info/PKG-INFO +1 -1
- ygg-0.1.29/src/ygg.egg-info/entry_points.txt +2 -0
- {ygg-0.1.27 → ygg-0.1.29}/src/yggdrasil/databricks/compute/cluster.py +8 -8
- {ygg-0.1.27 → ygg-0.1.29}/src/yggdrasil/databricks/compute/execution_context.py +1 -1
- {ygg-0.1.27 → ygg-0.1.29}/src/yggdrasil/pyutils/callable_serde.py +5 -3
- {ygg-0.1.27 → ygg-0.1.29}/src/yggdrasil/pyutils/python_env.py +3 -1
- ygg-0.1.27/src/ygg.egg-info/entry_points.txt +0 -2
- {ygg-0.1.27 → ygg-0.1.29}/LICENSE +0 -0
- {ygg-0.1.27 → ygg-0.1.29}/README.md +0 -0
- {ygg-0.1.27 → ygg-0.1.29}/setup.cfg +0 -0
- {ygg-0.1.27 → ygg-0.1.29}/src/ygg.egg-info/SOURCES.txt +0 -0
- {ygg-0.1.27 → ygg-0.1.29}/src/ygg.egg-info/dependency_links.txt +0 -0
- {ygg-0.1.27 → ygg-0.1.29}/src/ygg.egg-info/requires.txt +0 -0
- {ygg-0.1.27 → ygg-0.1.29}/src/ygg.egg-info/top_level.txt +0 -0
- {ygg-0.1.27 → ygg-0.1.29}/src/yggdrasil/__init__.py +0 -0
- {ygg-0.1.27 → ygg-0.1.29}/src/yggdrasil/databricks/__init__.py +0 -0
- {ygg-0.1.27 → ygg-0.1.29}/src/yggdrasil/databricks/compute/__init__.py +0 -0
- {ygg-0.1.27 → ygg-0.1.29}/src/yggdrasil/databricks/compute/remote.py +0 -0
- {ygg-0.1.27 → ygg-0.1.29}/src/yggdrasil/databricks/jobs/__init__.py +0 -0
- {ygg-0.1.27 → ygg-0.1.29}/src/yggdrasil/databricks/jobs/config.py +0 -0
- {ygg-0.1.27 → ygg-0.1.29}/src/yggdrasil/databricks/sql/__init__.py +0 -0
- {ygg-0.1.27 → ygg-0.1.29}/src/yggdrasil/databricks/sql/engine.py +0 -0
- {ygg-0.1.27 → ygg-0.1.29}/src/yggdrasil/databricks/sql/exceptions.py +0 -0
- {ygg-0.1.27 → ygg-0.1.29}/src/yggdrasil/databricks/sql/statement_result.py +0 -0
- {ygg-0.1.27 → ygg-0.1.29}/src/yggdrasil/databricks/sql/types.py +0 -0
- {ygg-0.1.27 → ygg-0.1.29}/src/yggdrasil/databricks/workspaces/__init__.py +0 -0
- {ygg-0.1.27 → ygg-0.1.29}/src/yggdrasil/databricks/workspaces/databricks_path.py +0 -0
- {ygg-0.1.27 → ygg-0.1.29}/src/yggdrasil/databricks/workspaces/workspace.py +0 -0
- {ygg-0.1.27 → ygg-0.1.29}/src/yggdrasil/dataclasses/__init__.py +0 -0
- {ygg-0.1.27 → ygg-0.1.29}/src/yggdrasil/dataclasses/dataclass.py +0 -0
- {ygg-0.1.27 → ygg-0.1.29}/src/yggdrasil/libs/__init__.py +0 -0
- {ygg-0.1.27 → ygg-0.1.29}/src/yggdrasil/libs/databrickslib.py +0 -0
- {ygg-0.1.27 → ygg-0.1.29}/src/yggdrasil/libs/extensions/__init__.py +0 -0
- {ygg-0.1.27 → ygg-0.1.29}/src/yggdrasil/libs/extensions/polars_extensions.py +0 -0
- {ygg-0.1.27 → ygg-0.1.29}/src/yggdrasil/libs/extensions/spark_extensions.py +0 -0
- {ygg-0.1.27 → ygg-0.1.29}/src/yggdrasil/libs/pandaslib.py +0 -0
- {ygg-0.1.27 → ygg-0.1.29}/src/yggdrasil/libs/polarslib.py +0 -0
- {ygg-0.1.27 → ygg-0.1.29}/src/yggdrasil/libs/sparklib.py +0 -0
- {ygg-0.1.27 → ygg-0.1.29}/src/yggdrasil/pyutils/__init__.py +0 -0
- {ygg-0.1.27 → ygg-0.1.29}/src/yggdrasil/pyutils/exceptions.py +0 -0
- {ygg-0.1.27 → ygg-0.1.29}/src/yggdrasil/pyutils/modules.py +0 -0
- {ygg-0.1.27 → ygg-0.1.29}/src/yggdrasil/pyutils/parallel.py +0 -0
- {ygg-0.1.27 → ygg-0.1.29}/src/yggdrasil/pyutils/retry.py +0 -0
- {ygg-0.1.27 → ygg-0.1.29}/src/yggdrasil/requests/__init__.py +0 -0
- {ygg-0.1.27 → ygg-0.1.29}/src/yggdrasil/requests/msal.py +0 -0
- {ygg-0.1.27 → ygg-0.1.29}/src/yggdrasil/requests/session.py +0 -0
- {ygg-0.1.27 → ygg-0.1.29}/src/yggdrasil/types/__init__.py +0 -0
- {ygg-0.1.27 → ygg-0.1.29}/src/yggdrasil/types/cast/__init__.py +0 -0
- {ygg-0.1.27 → ygg-0.1.29}/src/yggdrasil/types/cast/arrow_cast.py +0 -0
- {ygg-0.1.27 → ygg-0.1.29}/src/yggdrasil/types/cast/cast_options.py +0 -0
- {ygg-0.1.27 → ygg-0.1.29}/src/yggdrasil/types/cast/pandas_cast.py +0 -0
- {ygg-0.1.27 → ygg-0.1.29}/src/yggdrasil/types/cast/polars_cast.py +0 -0
- {ygg-0.1.27 → ygg-0.1.29}/src/yggdrasil/types/cast/polars_pandas_cast.py +0 -0
- {ygg-0.1.27 → ygg-0.1.29}/src/yggdrasil/types/cast/registry.py +0 -0
- {ygg-0.1.27 → ygg-0.1.29}/src/yggdrasil/types/cast/spark_cast.py +0 -0
- {ygg-0.1.27 → ygg-0.1.29}/src/yggdrasil/types/cast/spark_pandas_cast.py +0 -0
- {ygg-0.1.27 → ygg-0.1.29}/src/yggdrasil/types/cast/spark_polars_cast.py +0 -0
- {ygg-0.1.27 → ygg-0.1.29}/src/yggdrasil/types/libs.py +0 -0
- {ygg-0.1.27 → ygg-0.1.29}/src/yggdrasil/types/python_arrow.py +0 -0
- {ygg-0.1.27 → ygg-0.1.29}/src/yggdrasil/types/python_defaults.py +0 -0
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "ygg"
|
|
7
|
-
version = "0.1.
|
|
7
|
+
version = "0.1.29"
|
|
8
8
|
description = "Type-friendly utilities for moving data between Python objects, Arrow, Polars, Pandas, Spark, and Databricks"
|
|
9
9
|
readme = { file = "README.md", content-type = "text/markdown" }
|
|
10
10
|
license = { file = "LICENSE" }
|
|
@@ -45,7 +45,7 @@ dev = [
|
|
|
45
45
|
]
|
|
46
46
|
|
|
47
47
|
[project.scripts]
|
|
48
|
-
|
|
48
|
+
yggenv = "yggdrasil.pyutils.python_env:PythonEnv.cli"
|
|
49
49
|
|
|
50
50
|
[project.urls]
|
|
51
51
|
Homepage = "https://github.com/Platob/Yggdrasil"
|
|
@@ -135,7 +135,7 @@ class Cluster(WorkspaceService):
|
|
|
135
135
|
)
|
|
136
136
|
|
|
137
137
|
return inst
|
|
138
|
-
|
|
138
|
+
|
|
139
139
|
def push_python_environment(
|
|
140
140
|
self,
|
|
141
141
|
source: Optional[PythonEnv] = None,
|
|
@@ -179,6 +179,7 @@ class Cluster(WorkspaceService):
|
|
|
179
179
|
|
|
180
180
|
def pull_python_environment(
|
|
181
181
|
self,
|
|
182
|
+
name: Optional[str] = None,
|
|
182
183
|
target: Optional[PythonEnv] = None,
|
|
183
184
|
):
|
|
184
185
|
with self.context() as c:
|
|
@@ -186,15 +187,18 @@ class Cluster(WorkspaceService):
|
|
|
186
187
|
requirements = m.requirements
|
|
187
188
|
version_info = m.version_info
|
|
188
189
|
|
|
190
|
+
python_version = ".".join(str(_) for _ in version_info)
|
|
191
|
+
|
|
189
192
|
if target is None:
|
|
190
193
|
target = PythonEnv.create(
|
|
191
|
-
name=
|
|
192
|
-
|
|
194
|
+
name=name or self.name,
|
|
195
|
+
requirements=requirements,
|
|
196
|
+
python=python_version
|
|
193
197
|
)
|
|
194
198
|
else:
|
|
195
199
|
target.update(
|
|
196
200
|
requirements=requirements,
|
|
197
|
-
python=
|
|
201
|
+
python=python_version,
|
|
198
202
|
)
|
|
199
203
|
|
|
200
204
|
return target
|
|
@@ -642,7 +646,6 @@ class Cluster(WorkspaceService):
|
|
|
642
646
|
self,
|
|
643
647
|
_func: Optional[Callable] = None,
|
|
644
648
|
*,
|
|
645
|
-
before: Optional[Callable] = None,
|
|
646
649
|
language: Optional["Language"] = None,
|
|
647
650
|
env_keys: Optional[List[str]] = None,
|
|
648
651
|
env_variables: Optional[Dict[str, str]] = None,
|
|
@@ -669,15 +672,12 @@ class Cluster(WorkspaceService):
|
|
|
669
672
|
def decorator(func: Callable):
|
|
670
673
|
context = self.context(language=language or Language.PYTHON)
|
|
671
674
|
serialized = CallableSerde.from_callable(func)
|
|
672
|
-
do_before = CallableSerde.from_callable(before)
|
|
673
675
|
|
|
674
676
|
@functools.wraps(func)
|
|
675
677
|
def wrapper(*args, **kwargs):
|
|
676
678
|
if os.getenv("DATABRICKS_RUNTIME_VERSION") is not None:
|
|
677
679
|
return func(*args, **kwargs)
|
|
678
680
|
|
|
679
|
-
do_before()
|
|
680
|
-
|
|
681
681
|
return context.execute(
|
|
682
682
|
obj=serialized,
|
|
683
683
|
args=list(args),
|
|
@@ -291,7 +291,7 @@ print(json.dumps(meta))"""
|
|
|
291
291
|
|
|
292
292
|
serialized = CallableSerde.from_callable(func)
|
|
293
293
|
|
|
294
|
-
self.install_temporary_libraries(libraries=serialized.
|
|
294
|
+
self.install_temporary_libraries(libraries=serialized.pkg_root)
|
|
295
295
|
|
|
296
296
|
# Use dill of same version
|
|
297
297
|
current_version = (sys.version_info.major, sys.version_info.minor)
|
|
@@ -7,7 +7,6 @@ import inspect
|
|
|
7
7
|
import json
|
|
8
8
|
import struct
|
|
9
9
|
import sys
|
|
10
|
-
import textwrap
|
|
11
10
|
import zlib
|
|
12
11
|
from dataclasses import dataclass
|
|
13
12
|
from pathlib import Path
|
|
@@ -46,7 +45,7 @@ def _find_pkg_root_from_file(file_path: Path) -> Optional[Path]:
|
|
|
46
45
|
top_pkg_dir = d
|
|
47
46
|
d = d.parent
|
|
48
47
|
|
|
49
|
-
return top_pkg_dir
|
|
48
|
+
return top_pkg_dir if top_pkg_dir else None
|
|
50
49
|
|
|
51
50
|
|
|
52
51
|
def _callable_file_line(fn: Callable[..., Any]) -> Tuple[Optional[str], Optional[int]]:
|
|
@@ -248,7 +247,10 @@ class CallableSerde:
|
|
|
248
247
|
def from_callable(cls: type[T], x: Union[Callable[..., Any], T]) -> T:
|
|
249
248
|
if isinstance(x, cls):
|
|
250
249
|
return x
|
|
251
|
-
|
|
250
|
+
|
|
251
|
+
obj = cls(fn=x) # type: ignore[return-value]
|
|
252
|
+
|
|
253
|
+
return obj
|
|
252
254
|
|
|
253
255
|
# ----- lazy-ish properties (computed on access) -----
|
|
254
256
|
|
|
@@ -509,7 +509,9 @@ class PythonEnv:
|
|
|
509
509
|
|
|
510
510
|
py = str(Path(python).expanduser()) if isinstance(python, Path) else str(python)
|
|
511
511
|
log.info("creating env: name=%s root=%s python=%s", name, str(root), py)
|
|
512
|
-
_run_cmd([
|
|
512
|
+
_run_cmd([
|
|
513
|
+
uv, "venv", str(root), "--python", py, "--native-tls"
|
|
514
|
+
], cwd=cwd, env=env, check=check)
|
|
513
515
|
|
|
514
516
|
env_obj = cls(root)
|
|
515
517
|
if not env_obj.exists():
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|