ygg 0.1.27__tar.gz → 0.1.28__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 (62) hide show
  1. {ygg-0.1.27 → ygg-0.1.28}/PKG-INFO +1 -1
  2. {ygg-0.1.27 → ygg-0.1.28}/pyproject.toml +2 -2
  3. {ygg-0.1.27 → ygg-0.1.28}/src/ygg.egg-info/PKG-INFO +1 -1
  4. ygg-0.1.28/src/ygg.egg-info/entry_points.txt +2 -0
  5. {ygg-0.1.27 → ygg-0.1.28}/src/yggdrasil/databricks/compute/cluster.py +8 -4
  6. {ygg-0.1.27 → ygg-0.1.28}/src/yggdrasil/pyutils/callable_serde.py +30 -1
  7. {ygg-0.1.27 → ygg-0.1.28}/src/yggdrasil/pyutils/python_env.py +3 -1
  8. ygg-0.1.27/src/ygg.egg-info/entry_points.txt +0 -2
  9. {ygg-0.1.27 → ygg-0.1.28}/LICENSE +0 -0
  10. {ygg-0.1.27 → ygg-0.1.28}/README.md +0 -0
  11. {ygg-0.1.27 → ygg-0.1.28}/setup.cfg +0 -0
  12. {ygg-0.1.27 → ygg-0.1.28}/src/ygg.egg-info/SOURCES.txt +0 -0
  13. {ygg-0.1.27 → ygg-0.1.28}/src/ygg.egg-info/dependency_links.txt +0 -0
  14. {ygg-0.1.27 → ygg-0.1.28}/src/ygg.egg-info/requires.txt +0 -0
  15. {ygg-0.1.27 → ygg-0.1.28}/src/ygg.egg-info/top_level.txt +0 -0
  16. {ygg-0.1.27 → ygg-0.1.28}/src/yggdrasil/__init__.py +0 -0
  17. {ygg-0.1.27 → ygg-0.1.28}/src/yggdrasil/databricks/__init__.py +0 -0
  18. {ygg-0.1.27 → ygg-0.1.28}/src/yggdrasil/databricks/compute/__init__.py +0 -0
  19. {ygg-0.1.27 → ygg-0.1.28}/src/yggdrasil/databricks/compute/execution_context.py +0 -0
  20. {ygg-0.1.27 → ygg-0.1.28}/src/yggdrasil/databricks/compute/remote.py +0 -0
  21. {ygg-0.1.27 → ygg-0.1.28}/src/yggdrasil/databricks/jobs/__init__.py +0 -0
  22. {ygg-0.1.27 → ygg-0.1.28}/src/yggdrasil/databricks/jobs/config.py +0 -0
  23. {ygg-0.1.27 → ygg-0.1.28}/src/yggdrasil/databricks/sql/__init__.py +0 -0
  24. {ygg-0.1.27 → ygg-0.1.28}/src/yggdrasil/databricks/sql/engine.py +0 -0
  25. {ygg-0.1.27 → ygg-0.1.28}/src/yggdrasil/databricks/sql/exceptions.py +0 -0
  26. {ygg-0.1.27 → ygg-0.1.28}/src/yggdrasil/databricks/sql/statement_result.py +0 -0
  27. {ygg-0.1.27 → ygg-0.1.28}/src/yggdrasil/databricks/sql/types.py +0 -0
  28. {ygg-0.1.27 → ygg-0.1.28}/src/yggdrasil/databricks/workspaces/__init__.py +0 -0
  29. {ygg-0.1.27 → ygg-0.1.28}/src/yggdrasil/databricks/workspaces/databricks_path.py +0 -0
  30. {ygg-0.1.27 → ygg-0.1.28}/src/yggdrasil/databricks/workspaces/workspace.py +0 -0
  31. {ygg-0.1.27 → ygg-0.1.28}/src/yggdrasil/dataclasses/__init__.py +0 -0
  32. {ygg-0.1.27 → ygg-0.1.28}/src/yggdrasil/dataclasses/dataclass.py +0 -0
  33. {ygg-0.1.27 → ygg-0.1.28}/src/yggdrasil/libs/__init__.py +0 -0
  34. {ygg-0.1.27 → ygg-0.1.28}/src/yggdrasil/libs/databrickslib.py +0 -0
  35. {ygg-0.1.27 → ygg-0.1.28}/src/yggdrasil/libs/extensions/__init__.py +0 -0
  36. {ygg-0.1.27 → ygg-0.1.28}/src/yggdrasil/libs/extensions/polars_extensions.py +0 -0
  37. {ygg-0.1.27 → ygg-0.1.28}/src/yggdrasil/libs/extensions/spark_extensions.py +0 -0
  38. {ygg-0.1.27 → ygg-0.1.28}/src/yggdrasil/libs/pandaslib.py +0 -0
  39. {ygg-0.1.27 → ygg-0.1.28}/src/yggdrasil/libs/polarslib.py +0 -0
  40. {ygg-0.1.27 → ygg-0.1.28}/src/yggdrasil/libs/sparklib.py +0 -0
  41. {ygg-0.1.27 → ygg-0.1.28}/src/yggdrasil/pyutils/__init__.py +0 -0
  42. {ygg-0.1.27 → ygg-0.1.28}/src/yggdrasil/pyutils/exceptions.py +0 -0
  43. {ygg-0.1.27 → ygg-0.1.28}/src/yggdrasil/pyutils/modules.py +0 -0
  44. {ygg-0.1.27 → ygg-0.1.28}/src/yggdrasil/pyutils/parallel.py +0 -0
  45. {ygg-0.1.27 → ygg-0.1.28}/src/yggdrasil/pyutils/retry.py +0 -0
  46. {ygg-0.1.27 → ygg-0.1.28}/src/yggdrasil/requests/__init__.py +0 -0
  47. {ygg-0.1.27 → ygg-0.1.28}/src/yggdrasil/requests/msal.py +0 -0
  48. {ygg-0.1.27 → ygg-0.1.28}/src/yggdrasil/requests/session.py +0 -0
  49. {ygg-0.1.27 → ygg-0.1.28}/src/yggdrasil/types/__init__.py +0 -0
  50. {ygg-0.1.27 → ygg-0.1.28}/src/yggdrasil/types/cast/__init__.py +0 -0
  51. {ygg-0.1.27 → ygg-0.1.28}/src/yggdrasil/types/cast/arrow_cast.py +0 -0
  52. {ygg-0.1.27 → ygg-0.1.28}/src/yggdrasil/types/cast/cast_options.py +0 -0
  53. {ygg-0.1.27 → ygg-0.1.28}/src/yggdrasil/types/cast/pandas_cast.py +0 -0
  54. {ygg-0.1.27 → ygg-0.1.28}/src/yggdrasil/types/cast/polars_cast.py +0 -0
  55. {ygg-0.1.27 → ygg-0.1.28}/src/yggdrasil/types/cast/polars_pandas_cast.py +0 -0
  56. {ygg-0.1.27 → ygg-0.1.28}/src/yggdrasil/types/cast/registry.py +0 -0
  57. {ygg-0.1.27 → ygg-0.1.28}/src/yggdrasil/types/cast/spark_cast.py +0 -0
  58. {ygg-0.1.27 → ygg-0.1.28}/src/yggdrasil/types/cast/spark_pandas_cast.py +0 -0
  59. {ygg-0.1.27 → ygg-0.1.28}/src/yggdrasil/types/cast/spark_polars_cast.py +0 -0
  60. {ygg-0.1.27 → ygg-0.1.28}/src/yggdrasil/types/libs.py +0 -0
  61. {ygg-0.1.27 → ygg-0.1.28}/src/yggdrasil/types/python_arrow.py +0 -0
  62. {ygg-0.1.27 → ygg-0.1.28}/src/yggdrasil/types/python_defaults.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ygg
3
- Version: 0.1.27
3
+ Version: 0.1.28
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
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "ygg"
7
- version = "0.1.27"
7
+ version = "0.1.28"
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
- ygg-env = "yggdrasil.pyutils.python_env:PythonEnv.cli"
48
+ yggenv = "yggdrasil.pyutils.python_env:PythonEnv.cli"
49
49
 
50
50
  [project.urls]
51
51
  Homepage = "https://github.com/Platob/Yggdrasil"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ygg
3
- Version: 0.1.27
3
+ Version: 0.1.28
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
@@ -0,0 +1,2 @@
1
+ [console_scripts]
2
+ yggenv = yggdrasil.pyutils.python_env:PythonEnv.cli
@@ -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=f"dbx-{self.name}",
192
- python=".".join(str(_) for _ in version_info)
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=".".join(str(_) for _ in version_info)
201
+ python=python_version,
198
202
  )
199
203
 
200
204
  return target
@@ -242,13 +242,42 @@ class CallableSerde:
242
242
  _env_b64: Optional[str] = None
243
243
  _env_meta: Optional[Dict[str, Any]] = None
244
244
 
245
+ def __post_init__(self) -> None:
246
+ # If constructed as CallableSerde(fn=...), eagerly capture backing metadata.
247
+ if self.fn is not None:
248
+ self._init_private_from_fn(self.fn)
249
+
250
+ def _init_private_from_fn(self, fn: Callable[..., Any]) -> None:
251
+ """
252
+ Capture stable identity-ish metadata at creation time, so we don't rely
253
+ on lazy properties later (or after fn is dropped).
254
+ """
255
+ # Only set if not already provided (don't clobber loaded/explicit values).
256
+ if self._module is None:
257
+ self._module = getattr(fn, "__module__", None)
258
+
259
+ if self._qualname is None:
260
+ self._qualname = getattr(fn, "__qualname__", None)
261
+
262
+ if self._pkg_root is None:
263
+ f, _ = _callable_file_line(fn)
264
+ if f:
265
+ root = _find_pkg_root_from_file(Path(f))
266
+ if root:
267
+ self._pkg_root = str(root)
268
+
245
269
  # ----- construction -----
246
270
 
247
271
  @classmethod
248
272
  def from_callable(cls: type[T], x: Union[Callable[..., Any], T]) -> T:
249
273
  if isinstance(x, cls):
250
274
  return x
251
- return cls(fn=x) # type: ignore[return-value]
275
+
276
+ obj = cls(fn=x) # type: ignore[return-value]
277
+ # __post_init__ already ran, but this keeps it robust if dataclass changes.
278
+ obj._init_private_from_fn(x)
279
+
280
+ return obj
252
281
 
253
282
  # ----- lazy-ish properties (computed on access) -----
254
283
 
@@ -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([uv, "venv", str(root), "--python", py], cwd=cwd, env=env, check=check)
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():
@@ -1,2 +0,0 @@
1
- [console_scripts]
2
- ygg-env = yggdrasil.pyutils.python_env:PythonEnv.cli
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes