dagster-sling 0.27.12__tar.gz → 0.27.14__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.
Potentially problematic release.
This version of dagster-sling might be problematic. Click here for more details.
- {dagster_sling-0.27.12/dagster_sling.egg-info → dagster_sling-0.27.14}/PKG-INFO +2 -2
- {dagster_sling-0.27.12 → dagster_sling-0.27.14}/dagster_sling/components/sling_replication_collection/component.py +63 -50
- {dagster_sling-0.27.12 → dagster_sling-0.27.14}/dagster_sling/resources.py +6 -2
- dagster_sling-0.27.14/dagster_sling/version.py +1 -0
- {dagster_sling-0.27.12 → dagster_sling-0.27.14/dagster_sling.egg-info}/PKG-INFO +2 -2
- {dagster_sling-0.27.12 → dagster_sling-0.27.14}/dagster_sling.egg-info/requires.txt +1 -1
- {dagster_sling-0.27.12 → dagster_sling-0.27.14}/setup.py +1 -1
- dagster_sling-0.27.12/dagster_sling/version.py +0 -1
- {dagster_sling-0.27.12 → dagster_sling-0.27.14}/LICENSE +0 -0
- {dagster_sling-0.27.12 → dagster_sling-0.27.14}/MANIFEST.in +0 -0
- {dagster_sling-0.27.12 → dagster_sling-0.27.14}/README.md +0 -0
- {dagster_sling-0.27.12 → dagster_sling-0.27.14}/dagster_sling/__init__.py +0 -0
- {dagster_sling-0.27.12 → dagster_sling-0.27.14}/dagster_sling/asset_decorator.py +0 -0
- {dagster_sling-0.27.12 → dagster_sling-0.27.14}/dagster_sling/asset_defs.py +0 -0
- {dagster_sling-0.27.12 → dagster_sling-0.27.14}/dagster_sling/components/__init__.py +0 -0
- {dagster_sling-0.27.12 → dagster_sling-0.27.14}/dagster_sling/components/sling_replication_collection/__init__.py +0 -0
- {dagster_sling-0.27.12 → dagster_sling-0.27.14}/dagster_sling/components/sling_replication_collection/scaffolder.py +0 -0
- {dagster_sling-0.27.12 → dagster_sling-0.27.14}/dagster_sling/dagster_sling_translator.py +0 -0
- {dagster_sling-0.27.12 → dagster_sling-0.27.14}/dagster_sling/py.typed +0 -0
- {dagster_sling-0.27.12 → dagster_sling-0.27.14}/dagster_sling/sling_event_iterator.py +0 -0
- {dagster_sling-0.27.12 → dagster_sling-0.27.14}/dagster_sling/sling_replication.py +0 -0
- {dagster_sling-0.27.12 → dagster_sling-0.27.14}/dagster_sling.egg-info/SOURCES.txt +0 -0
- {dagster_sling-0.27.12 → dagster_sling-0.27.14}/dagster_sling.egg-info/dependency_links.txt +0 -0
- {dagster_sling-0.27.12 → dagster_sling-0.27.14}/dagster_sling.egg-info/entry_points.txt +0 -0
- {dagster_sling-0.27.12 → dagster_sling-0.27.14}/dagster_sling.egg-info/not-zip-safe +0 -0
- {dagster_sling-0.27.12 → dagster_sling-0.27.14}/dagster_sling.egg-info/top_level.txt +0 -0
- {dagster_sling-0.27.12 → dagster_sling-0.27.14}/integration.yaml +0 -0
- {dagster_sling-0.27.12 → dagster_sling-0.27.14}/setup.cfg +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: dagster-sling
|
|
3
|
-
Version: 0.27.
|
|
3
|
+
Version: 0.27.14
|
|
4
4
|
Summary: Package for performing ETL/ELT tasks with Sling in Dagster.
|
|
5
5
|
Home-page: https://github.com/dagster-io/dagster/tree/master/python_modules/libraries/dagster-sling
|
|
6
6
|
Author: Dagster Labs
|
|
@@ -15,7 +15,7 @@ Classifier: License :: OSI Approved :: Apache Software License
|
|
|
15
15
|
Classifier: Operating System :: OS Independent
|
|
16
16
|
Requires-Python: >=3.9,<3.14
|
|
17
17
|
License-File: LICENSE
|
|
18
|
-
Requires-Dist: dagster==1.11.
|
|
18
|
+
Requires-Dist: dagster==1.11.14
|
|
19
19
|
Requires-Dist: sling>=1.1.5
|
|
20
20
|
Requires-Dist: sling-mac-arm64; platform_system == "Darwin" and platform_machine == "arm64"
|
|
21
21
|
Provides-Extra: test
|
|
@@ -20,7 +20,12 @@ from dagster.components.core.context import ComponentLoadContext
|
|
|
20
20
|
from dagster.components.resolved.context import ResolutionContext
|
|
21
21
|
from dagster.components.resolved.core_models import OpSpec
|
|
22
22
|
from dagster.components.scaffold.scaffold import scaffold_with
|
|
23
|
-
from dagster.components.utils.translation import
|
|
23
|
+
from dagster.components.utils.translation import (
|
|
24
|
+
ComponentTranslator,
|
|
25
|
+
TranslationFn,
|
|
26
|
+
TranslationFnResolver,
|
|
27
|
+
create_component_translator_cls,
|
|
28
|
+
)
|
|
24
29
|
from dagster_shared.utils.warnings import deprecation_warning
|
|
25
30
|
from pydantic import BaseModel, ConfigDict, Field
|
|
26
31
|
from typing_extensions import TypeAlias
|
|
@@ -35,15 +40,6 @@ from dagster_sling.resources import AssetExecutionContext, SlingConnectionResour
|
|
|
35
40
|
SlingMetadataAddons: TypeAlias = Literal["column_metadata", "row_count"]
|
|
36
41
|
|
|
37
42
|
|
|
38
|
-
class ProxyDagsterSlingTranslator(DagsterSlingTranslator):
|
|
39
|
-
def __init__(self, fn: TranslationFn[Mapping[str, Any]]):
|
|
40
|
-
self._fn = fn
|
|
41
|
-
|
|
42
|
-
def get_asset_spec(self, stream_definition: Mapping[str, Any]) -> AssetSpec:
|
|
43
|
-
base_asset_spec = super().get_asset_spec(stream_definition)
|
|
44
|
-
return self._fn(base_asset_spec, stream_definition)
|
|
45
|
-
|
|
46
|
-
|
|
47
43
|
@dataclass
|
|
48
44
|
class SlingReplicationSpecModel(Resolvable):
|
|
49
45
|
path: str
|
|
@@ -56,33 +52,16 @@ class SlingReplicationSpecModel(Resolvable):
|
|
|
56
52
|
),
|
|
57
53
|
]
|
|
58
54
|
] = None
|
|
59
|
-
include_metadata:
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
context: ResolutionContext,
|
|
70
|
-
sling,
|
|
71
|
-
) -> Optional[SlingResource]:
|
|
72
|
-
if sling:
|
|
73
|
-
deprecation_warning(
|
|
74
|
-
"The `sling` field is deprecated, use `connections` instead. This field will be removed in a future release.",
|
|
75
|
-
"1.11.1",
|
|
76
|
-
)
|
|
77
|
-
return SlingResource(**context.resolve_value(sling.model_dump())) if sling else None
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
def replicate(
|
|
81
|
-
context: AssetExecutionContext,
|
|
82
|
-
connections: list[SlingConnectionResource],
|
|
83
|
-
) -> Iterator[Union[AssetMaterialization, MaterializeResult]]:
|
|
84
|
-
sling = SlingResource(connections=connections)
|
|
85
|
-
yield from sling.replicate(context=context)
|
|
55
|
+
include_metadata: Annotated[
|
|
56
|
+
list[SlingMetadataAddons],
|
|
57
|
+
Resolver.default(
|
|
58
|
+
description="Optionally include additional metadata in materializations generated while executing your Sling models",
|
|
59
|
+
examples=[
|
|
60
|
+
["row_count"],
|
|
61
|
+
["row_count", "column_metadata"],
|
|
62
|
+
],
|
|
63
|
+
),
|
|
64
|
+
] = field(default_factory=list)
|
|
86
65
|
|
|
87
66
|
|
|
88
67
|
class SlingConnectionResourcePropertiesModel(Resolvable, BaseModel):
|
|
@@ -123,6 +102,18 @@ ResolvedSlingConnections: TypeAlias = Annotated[
|
|
|
123
102
|
]
|
|
124
103
|
|
|
125
104
|
|
|
105
|
+
def resolve_resource(
|
|
106
|
+
context: ResolutionContext,
|
|
107
|
+
sling,
|
|
108
|
+
) -> Optional[SlingResource]:
|
|
109
|
+
if sling:
|
|
110
|
+
deprecation_warning(
|
|
111
|
+
"The `sling` field is deprecated, use `connections` instead. This field will be removed in a future release.",
|
|
112
|
+
"1.11.1",
|
|
113
|
+
)
|
|
114
|
+
return SlingResource(**context.resolve_value(sling.model_dump())) if sling else None
|
|
115
|
+
|
|
116
|
+
|
|
126
117
|
@public
|
|
127
118
|
@scaffold_with(SlingReplicationComponentScaffolder)
|
|
128
119
|
@dataclass
|
|
@@ -148,28 +139,24 @@ class SlingReplicationCollectionComponent(Component, Resolvable):
|
|
|
148
139
|
def sling_resource(self) -> SlingResource:
|
|
149
140
|
return self.resource or SlingResource(connections=self.connections)
|
|
150
141
|
|
|
142
|
+
@cached_property
|
|
143
|
+
def _base_translator(self) -> DagsterSlingTranslator:
|
|
144
|
+
return DagsterSlingTranslator()
|
|
145
|
+
|
|
146
|
+
def get_asset_spec(self, stream_definition: Mapping[str, Any]) -> AssetSpec:
|
|
147
|
+
return self._base_translator.get_asset_spec(stream_definition)
|
|
148
|
+
|
|
151
149
|
def build_asset(
|
|
152
150
|
self, context: ComponentLoadContext, replication_spec_model: SlingReplicationSpecModel
|
|
153
151
|
) -> AssetsDefinition:
|
|
154
152
|
op_spec = replication_spec_model.op or OpSpec()
|
|
155
|
-
|
|
156
|
-
class ReplicationTranslatorWithCodeReferences(DagsterSlingTranslator):
|
|
157
|
-
def get_asset_spec(self, stream_definition: Mapping[str, Any]) -> AssetSpec:
|
|
158
|
-
asset_spec = replication_spec_model.translator.get_asset_spec(stream_definition)
|
|
159
|
-
return merge_code_references(
|
|
160
|
-
asset_spec,
|
|
161
|
-
[
|
|
162
|
-
LocalFileCodeReference(
|
|
163
|
-
file_path=str(context.path / replication_spec_model.path)
|
|
164
|
-
)
|
|
165
|
-
],
|
|
166
|
-
)
|
|
153
|
+
translator = SlingComponentTranslator(self, replication_spec_model, context.path)
|
|
167
154
|
|
|
168
155
|
@sling_assets(
|
|
169
156
|
name=op_spec.name or Path(replication_spec_model.path).stem,
|
|
170
157
|
op_tags=op_spec.tags,
|
|
171
158
|
replication_config=context.path / replication_spec_model.path,
|
|
172
|
-
dagster_sling_translator=
|
|
159
|
+
dagster_sling_translator=translator,
|
|
173
160
|
backfill_policy=op_spec.backfill_policy,
|
|
174
161
|
)
|
|
175
162
|
def _asset(context: AssetExecutionContext):
|
|
@@ -198,3 +185,29 @@ class SlingReplicationCollectionComponent(Component, Resolvable):
|
|
|
198
185
|
return Definitions(
|
|
199
186
|
assets=[self.build_asset(context, replication) for replication in self.replications],
|
|
200
187
|
)
|
|
188
|
+
|
|
189
|
+
|
|
190
|
+
class SlingComponentTranslator(
|
|
191
|
+
create_component_translator_cls(SlingReplicationCollectionComponent, DagsterSlingTranslator),
|
|
192
|
+
ComponentTranslator[SlingReplicationCollectionComponent],
|
|
193
|
+
):
|
|
194
|
+
def __init__(
|
|
195
|
+
self,
|
|
196
|
+
component: SlingReplicationCollectionComponent,
|
|
197
|
+
replication_spec: SlingReplicationSpecModel,
|
|
198
|
+
base_path: Path,
|
|
199
|
+
):
|
|
200
|
+
self._component = component
|
|
201
|
+
self._replication_spec = replication_spec
|
|
202
|
+
self._base_path = base_path
|
|
203
|
+
|
|
204
|
+
def get_asset_spec(self, stream_definition: Mapping[str, Any]) -> AssetSpec:
|
|
205
|
+
spec = super().get_asset_spec(stream_definition)
|
|
206
|
+
if self._replication_spec.translation is not None:
|
|
207
|
+
spec = self._replication_spec.translation(spec, stream_definition)
|
|
208
|
+
|
|
209
|
+
# always add code references to the replication spec
|
|
210
|
+
code_reference = LocalFileCodeReference(
|
|
211
|
+
file_path=str(self._base_path / self._replication_spec.path)
|
|
212
|
+
)
|
|
213
|
+
return merge_code_references(spec, [code_reference])
|
|
@@ -279,8 +279,12 @@ class SlingResource(ConfigurableResource):
|
|
|
279
279
|
yield
|
|
280
280
|
|
|
281
281
|
def _clean_line(self, line: str) -> str:
|
|
282
|
-
"""Removes ANSI escape sequences from a line of output."""
|
|
283
|
-
|
|
282
|
+
"""Removes ANSI escape sequences and Sling log prefixes from a line of output."""
|
|
283
|
+
line = ANSI_ESCAPE.sub("", line)
|
|
284
|
+
# Remove Sling log format prefix: "{timestamp} {LEVEL} " (e.g., "1:04PM INF ")
|
|
285
|
+
# Match pattern: optional timestamp followed by log level (INF, WRN, ERR, DBG) and space
|
|
286
|
+
line = re.sub(r"^\d{1,2}:\d{2}[AP]M\s+(INF|WRN|ERR|DBG)\s+", "", line)
|
|
287
|
+
return line
|
|
284
288
|
|
|
285
289
|
def _clean_timestamp_log(self, line: str):
|
|
286
290
|
"""Remove timestamp from log gather from sling cli to reduce redundency in dagster log.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "0.27.14"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: dagster-sling
|
|
3
|
-
Version: 0.27.
|
|
3
|
+
Version: 0.27.14
|
|
4
4
|
Summary: Package for performing ETL/ELT tasks with Sling in Dagster.
|
|
5
5
|
Home-page: https://github.com/dagster-io/dagster/tree/master/python_modules/libraries/dagster-sling
|
|
6
6
|
Author: Dagster Labs
|
|
@@ -15,7 +15,7 @@ Classifier: License :: OSI Approved :: Apache Software License
|
|
|
15
15
|
Classifier: Operating System :: OS Independent
|
|
16
16
|
Requires-Python: >=3.9,<3.14
|
|
17
17
|
License-File: LICENSE
|
|
18
|
-
Requires-Dist: dagster==1.11.
|
|
18
|
+
Requires-Dist: dagster==1.11.14
|
|
19
19
|
Requires-Dist: sling>=1.1.5
|
|
20
20
|
Requires-Dist: sling-mac-arm64; platform_system == "Darwin" and platform_machine == "arm64"
|
|
21
21
|
Provides-Extra: test
|
|
@@ -35,7 +35,7 @@ setup(
|
|
|
35
35
|
include_package_data=True,
|
|
36
36
|
python_requires=">=3.9,<3.14",
|
|
37
37
|
install_requires=[
|
|
38
|
-
"dagster==1.11.
|
|
38
|
+
"dagster==1.11.14",
|
|
39
39
|
"sling>=1.1.5",
|
|
40
40
|
# Required due to a bug in uv that can cause sling-linux-amd64 to be installed instead.
|
|
41
41
|
# See: https://github.com/astral-sh/uv/issues/10945
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
__version__ = "0.27.12"
|
|
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
|