dagster-omni 0.27.16__py3-none-any.whl → 0.28.0__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.

Potentially problematic release.


This version of dagster-omni might be problematic. Click here for more details.

dagster_omni/component.py CHANGED
@@ -4,7 +4,7 @@ from pathlib import Path
4
4
  from typing import Optional
5
5
 
6
6
  import dagster as dg
7
- from dagster._annotations import preview
7
+ from dagster._annotations import preview, public
8
8
  from dagster._core.errors import DagsterInvalidDefinitionError
9
9
  from dagster.components.component.state_backed_component import StateBackedComponent
10
10
  from dagster.components.utils.defs_state import (
@@ -26,6 +26,21 @@ from dagster_omni.workspace import OmniWorkspace
26
26
 
27
27
  @preview
28
28
  class OmniComponent(StateBackedComponent, dg.Model, dg.Resolvable):
29
+ """Pulls in the contents of an Omni workspace into Dagster assets.
30
+
31
+ Example:
32
+
33
+ .. code-block:: yaml
34
+
35
+ # defs.yaml
36
+
37
+ type: dagster_omni.OmniComponent
38
+ attributes:
39
+ workspace:
40
+ base_url: https://your-company.omniapp.co
41
+ api_key: "{{ env.OMNI_API_KEY }}"
42
+ """
43
+
29
44
  workspace: OmniWorkspace = Field(
30
45
  description="Defines configuration for interacting with an Omni instance.",
31
46
  )
@@ -81,10 +96,45 @@ class OmniComponent(StateBackedComponent, dg.Model, dg.Resolvable):
81
96
  return dg.AssetSpec(key=dg.AssetKey([data.obj.query_config.table]))
82
97
  return None
83
98
 
99
+ @public
84
100
  def get_asset_spec(
85
101
  self, context: dg.ComponentLoadContext, data: OmniTranslatorData
86
102
  ) -> Optional[dg.AssetSpec]:
87
- """Core function for converting an Omni document into an AssetSpec object."""
103
+ """Generates an AssetSpec for a given Omni document.
104
+
105
+ This method can be overridden in a subclass to customize how Omni documents
106
+ (workbooks, queries) are converted to Dagster asset specs. By default, it applies
107
+ any configured translation function to the base asset spec.
108
+
109
+ Args:
110
+ context: The component load context provided by Dagster
111
+ data: The OmniTranslatorData containing information about the Omni document
112
+
113
+ Returns:
114
+ An AssetSpec that represents the Omni document as a Dagster asset, or None
115
+ if the document should not be represented as an asset
116
+
117
+ Example:
118
+ Override this method to add custom metadata based on document properties:
119
+
120
+ .. code-block:: python
121
+
122
+ from dagster_omni import OmniComponent
123
+ import dagster as dg
124
+
125
+ class CustomOmniComponent(OmniComponent):
126
+ def get_asset_spec(self, context, data):
127
+ base_spec = super().get_asset_spec(context, data)
128
+ if base_spec:
129
+ return base_spec.replace_attributes(
130
+ metadata={
131
+ **base_spec.metadata,
132
+ "omni_type": type(data.obj).__name__,
133
+ "workspace": data.workspace_data.workspace_id
134
+ }
135
+ )
136
+ return None
137
+ """
88
138
  base_asset_spec = self._get_default_omni_spec(context, data, self.workspace)
89
139
  if self.translation and base_asset_spec:
90
140
  return self.translation(base_asset_spec, data)
dagster_omni/version.py CHANGED
@@ -1 +1 @@
1
- __version__ = "0.27.16"
1
+ __version__ = "0.28.0"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: dagster_omni
3
- Version: 0.27.16
3
+ Version: 0.28.0
4
4
  Summary: Package for integrating Omni with Dagster.
5
5
  Home-page: https://github.com/dagster-io/dagster/tree/master/python_modules/libraries/dagster-omni
6
6
  Author: Dagster Labs
@@ -14,7 +14,7 @@ Classifier: Programming Language :: Python :: 3.13
14
14
  Classifier: License :: OSI Approved :: Apache Software License
15
15
  Classifier: Operating System :: OS Independent
16
16
  License-File: LICENSE
17
- Requires-Dist: dagster==1.11.16
17
+ Requires-Dist: dagster==1.12.0
18
18
  Requires-Dist: aiohttp
19
19
  Requires-Dist: python-dateutil
20
20
  Dynamic: author
@@ -0,0 +1,12 @@
1
+ dagster_omni/__init__.py,sha256=6QUEBSqA3cRAb4kSWqkdvkUiKMbk0NY1YFdJPW0JEkQ,249
2
+ dagster_omni/component.py,sha256=47CRd2190icq6MAynZzXU6893R5EjPmwMfED4W-tk90,7555
3
+ dagster_omni/objects.py,sha256=4cknF4xIljTYYWYCOKe8Tkaled0_Gq9u9g8Ze_mYnyQ,4960
4
+ dagster_omni/py.typed,sha256=mDShSrm8qg9qjacQc2F-rI8ATllqP6EdgHuEYxuCXZ0,7
5
+ dagster_omni/translation.py,sha256=ExEc_WU7qbnJ5fpWUdK_TSGRJQ-a2H13apqwM1LvdaY,4820
6
+ dagster_omni/version.py,sha256=MRQGtOXBhcDKeeNOL0LiB-cllo6kfd8_KGJOvaDp0XQ,23
7
+ dagster_omni/workspace.py,sha256=C2fjZIw64TEKWRtpzt6rRm5MSY4RKCXJW22ANJBjY-o,5893
8
+ dagster_omni-0.28.0.dist-info/licenses/LICENSE,sha256=lY5yc1KHX4HoXjlWnIPGcCAsnNney2rb8M8ccT6NzRQ,11347
9
+ dagster_omni-0.28.0.dist-info/METADATA,sha256=MeG36hofIU6llozLUL9uMTqxGIAazeu1khqNz2kQMO0,912
10
+ dagster_omni-0.28.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
11
+ dagster_omni-0.28.0.dist-info/top_level.txt,sha256=FJO_1xyIWRN_nGhCDQPirG5NrEsB-wPR7eY5puEgJes,13
12
+ dagster_omni-0.28.0.dist-info/RECORD,,
@@ -1,12 +0,0 @@
1
- dagster_omni/__init__.py,sha256=6QUEBSqA3cRAb4kSWqkdvkUiKMbk0NY1YFdJPW0JEkQ,249
2
- dagster_omni/component.py,sha256=DMyfsfywAfa4CI8trBRGdpIUxVgTvHbK5P00v5cn9HE,5724
3
- dagster_omni/objects.py,sha256=4cknF4xIljTYYWYCOKe8Tkaled0_Gq9u9g8Ze_mYnyQ,4960
4
- dagster_omni/py.typed,sha256=mDShSrm8qg9qjacQc2F-rI8ATllqP6EdgHuEYxuCXZ0,7
5
- dagster_omni/translation.py,sha256=ExEc_WU7qbnJ5fpWUdK_TSGRJQ-a2H13apqwM1LvdaY,4820
6
- dagster_omni/version.py,sha256=gNIskoVbgqFeY6KiyOzkhfP7GLwnNVmVeil7tBvkL44,24
7
- dagster_omni/workspace.py,sha256=C2fjZIw64TEKWRtpzt6rRm5MSY4RKCXJW22ANJBjY-o,5893
8
- dagster_omni-0.27.16.dist-info/licenses/LICENSE,sha256=lY5yc1KHX4HoXjlWnIPGcCAsnNney2rb8M8ccT6NzRQ,11347
9
- dagster_omni-0.27.16.dist-info/METADATA,sha256=j1IFP2tkc7pbSdd2e2sJyRlkKNtyL9fysJvK2TFdn-w,914
10
- dagster_omni-0.27.16.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
11
- dagster_omni-0.27.16.dist-info/top_level.txt,sha256=FJO_1xyIWRN_nGhCDQPirG5NrEsB-wPR7eY5puEgJes,13
12
- dagster_omni-0.27.16.dist-info/RECORD,,