ygg 0.1.57__py3-none-any.whl → 0.1.60__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.
Files changed (42) hide show
  1. {ygg-0.1.57.dist-info → ygg-0.1.60.dist-info}/METADATA +1 -1
  2. ygg-0.1.60.dist-info/RECORD +74 -0
  3. yggdrasil/ai/__init__.py +2 -0
  4. yggdrasil/ai/session.py +89 -0
  5. yggdrasil/ai/sql_session.py +310 -0
  6. yggdrasil/databricks/__init__.py +0 -3
  7. yggdrasil/databricks/compute/cluster.py +68 -113
  8. yggdrasil/databricks/compute/command_execution.py +674 -0
  9. yggdrasil/databricks/compute/exceptions.py +19 -0
  10. yggdrasil/databricks/compute/execution_context.py +491 -282
  11. yggdrasil/databricks/compute/remote.py +4 -14
  12. yggdrasil/databricks/exceptions.py +10 -0
  13. yggdrasil/databricks/sql/__init__.py +0 -4
  14. yggdrasil/databricks/sql/engine.py +161 -173
  15. yggdrasil/databricks/sql/exceptions.py +9 -1
  16. yggdrasil/databricks/sql/statement_result.py +108 -120
  17. yggdrasil/databricks/sql/warehouse.py +331 -92
  18. yggdrasil/databricks/workspaces/io.py +89 -9
  19. yggdrasil/databricks/workspaces/path.py +120 -72
  20. yggdrasil/databricks/workspaces/workspace.py +214 -61
  21. yggdrasil/exceptions.py +7 -0
  22. yggdrasil/libs/databrickslib.py +23 -18
  23. yggdrasil/libs/extensions/spark_extensions.py +1 -1
  24. yggdrasil/libs/pandaslib.py +15 -6
  25. yggdrasil/libs/polarslib.py +49 -13
  26. yggdrasil/pyutils/__init__.py +1 -2
  27. yggdrasil/pyutils/callable_serde.py +12 -19
  28. yggdrasil/pyutils/exceptions.py +16 -0
  29. yggdrasil/pyutils/python_env.py +14 -13
  30. yggdrasil/pyutils/waiting_config.py +171 -0
  31. yggdrasil/types/cast/arrow_cast.py +3 -0
  32. yggdrasil/types/cast/pandas_cast.py +157 -169
  33. yggdrasil/types/cast/polars_cast.py +11 -43
  34. yggdrasil/types/dummy_class.py +81 -0
  35. yggdrasil/version.py +1 -1
  36. ygg-0.1.57.dist-info/RECORD +0 -66
  37. yggdrasil/databricks/ai/loki.py +0 -53
  38. {ygg-0.1.57.dist-info → ygg-0.1.60.dist-info}/WHEEL +0 -0
  39. {ygg-0.1.57.dist-info → ygg-0.1.60.dist-info}/entry_points.txt +0 -0
  40. {ygg-0.1.57.dist-info → ygg-0.1.60.dist-info}/licenses/LICENSE +0 -0
  41. {ygg-0.1.57.dist-info → ygg-0.1.60.dist-info}/top_level.txt +0 -0
  42. /yggdrasil/{databricks/ai/__init__.py → pyutils/mimetypes.py} +0 -0
@@ -1,53 +0,0 @@
1
- from typing import Optional
2
- from dataclasses import field, dataclass
3
-
4
- from ..workspaces.workspace import WorkspaceService
5
-
6
- try:
7
- from openai import OpenAI
8
-
9
- def make_openai_client(
10
- api_key: str,
11
- base_url: str
12
- ):
13
- return OpenAI(
14
- api_key=api_key,
15
- base_url=base_url
16
- )
17
- except ImportError:
18
- class OpenAI:
19
- pass
20
-
21
- def make_openai_client(
22
- api_key: str,
23
- base_url: str
24
- ):
25
- from openai import OpenAI
26
-
27
- return OpenAI(
28
- api_key=api_key,
29
- base_url=base_url
30
- )
31
-
32
- __all__ = [
33
- "Loki"
34
- ]
35
-
36
-
37
- @dataclass
38
- class Loki(WorkspaceService):
39
- model: str = "databricks-gemini-2-5-flash"
40
-
41
- _openai_client: Optional[OpenAI] = field(repr=False, hash=False, default=None)
42
-
43
- @property
44
- def openai_client(self):
45
- if self._openai_client is None:
46
- self._openai_client = self.make_openai_client()
47
- return self._openai_client
48
-
49
- def make_openai_client(self):
50
- return make_openai_client(
51
- api_key=self.workspace.current_token(),
52
- base_url=self.workspace.host + "/serving-endpoints"
53
- )
File without changes