dagster-sling 0.27.15__tar.gz → 0.28.0__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.15/dagster_sling.egg-info → dagster_sling-0.28.0}/PKG-INFO +2 -2
- {dagster_sling-0.27.15 → dagster_sling-0.28.0}/dagster_sling/components/sling_replication_collection/component.py +62 -0
- {dagster_sling-0.27.15 → dagster_sling-0.28.0}/dagster_sling/dagster_sling_translator.py +1 -56
- dagster_sling-0.28.0/dagster_sling/version.py +1 -0
- {dagster_sling-0.27.15 → dagster_sling-0.28.0/dagster_sling.egg-info}/PKG-INFO +2 -2
- {dagster_sling-0.27.15 → dagster_sling-0.28.0}/dagster_sling.egg-info/requires.txt +1 -1
- {dagster_sling-0.27.15 → dagster_sling-0.28.0}/setup.py +1 -1
- dagster_sling-0.27.15/dagster_sling/version.py +0 -1
- {dagster_sling-0.27.15 → dagster_sling-0.28.0}/LICENSE +0 -0
- {dagster_sling-0.27.15 → dagster_sling-0.28.0}/MANIFEST.in +0 -0
- {dagster_sling-0.27.15 → dagster_sling-0.28.0}/README.md +0 -0
- {dagster_sling-0.27.15 → dagster_sling-0.28.0}/dagster_sling/__init__.py +0 -0
- {dagster_sling-0.27.15 → dagster_sling-0.28.0}/dagster_sling/asset_decorator.py +0 -0
- {dagster_sling-0.27.15 → dagster_sling-0.28.0}/dagster_sling/asset_defs.py +0 -0
- {dagster_sling-0.27.15 → dagster_sling-0.28.0}/dagster_sling/components/__init__.py +0 -0
- {dagster_sling-0.27.15 → dagster_sling-0.28.0}/dagster_sling/components/sling_replication_collection/__init__.py +0 -0
- {dagster_sling-0.27.15 → dagster_sling-0.28.0}/dagster_sling/components/sling_replication_collection/scaffolder.py +0 -0
- {dagster_sling-0.27.15 → dagster_sling-0.28.0}/dagster_sling/py.typed +0 -0
- {dagster_sling-0.27.15 → dagster_sling-0.28.0}/dagster_sling/resources.py +0 -0
- {dagster_sling-0.27.15 → dagster_sling-0.28.0}/dagster_sling/sling_event_iterator.py +0 -0
- {dagster_sling-0.27.15 → dagster_sling-0.28.0}/dagster_sling/sling_replication.py +0 -0
- {dagster_sling-0.27.15 → dagster_sling-0.28.0}/dagster_sling.egg-info/SOURCES.txt +0 -0
- {dagster_sling-0.27.15 → dagster_sling-0.28.0}/dagster_sling.egg-info/dependency_links.txt +0 -0
- {dagster_sling-0.27.15 → dagster_sling-0.28.0}/dagster_sling.egg-info/entry_points.txt +0 -0
- {dagster_sling-0.27.15 → dagster_sling-0.28.0}/dagster_sling.egg-info/not-zip-safe +0 -0
- {dagster_sling-0.27.15 → dagster_sling-0.28.0}/dagster_sling.egg-info/top_level.txt +0 -0
- {dagster_sling-0.27.15 → dagster_sling-0.28.0}/integration.yaml +0 -0
- {dagster_sling-0.27.15 → dagster_sling-0.28.0}/setup.cfg +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: dagster-sling
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.28.0
|
|
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.
|
|
18
|
+
Requires-Dist: dagster==1.12.0
|
|
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
|
|
@@ -143,7 +143,40 @@ class SlingReplicationCollectionComponent(Component, Resolvable):
|
|
|
143
143
|
def _base_translator(self) -> DagsterSlingTranslator:
|
|
144
144
|
return DagsterSlingTranslator()
|
|
145
145
|
|
|
146
|
+
@public
|
|
146
147
|
def get_asset_spec(self, stream_definition: Mapping[str, Any]) -> AssetSpec:
|
|
148
|
+
"""Generates an AssetSpec for a given Sling stream definition.
|
|
149
|
+
|
|
150
|
+
This method can be overridden in a subclass to customize how Sling stream definitions
|
|
151
|
+
are converted to Dagster asset specs. By default, it delegates to the configured
|
|
152
|
+
DagsterSlingTranslator.
|
|
153
|
+
|
|
154
|
+
Args:
|
|
155
|
+
stream_definition: A dictionary representing a single stream from the Sling
|
|
156
|
+
replication config, containing source and target information
|
|
157
|
+
|
|
158
|
+
Returns:
|
|
159
|
+
An AssetSpec that represents the Sling stream as a Dagster asset
|
|
160
|
+
|
|
161
|
+
Example:
|
|
162
|
+
Override this method to add custom metadata based on stream properties:
|
|
163
|
+
|
|
164
|
+
.. code-block:: python
|
|
165
|
+
|
|
166
|
+
from dagster_sling import SlingReplicationCollectionComponent
|
|
167
|
+
from dagster import AssetSpec
|
|
168
|
+
|
|
169
|
+
class CustomSlingComponent(SlingReplicationCollectionComponent):
|
|
170
|
+
def get_asset_spec(self, stream_definition):
|
|
171
|
+
base_spec = super().get_asset_spec(stream_definition)
|
|
172
|
+
return base_spec.replace_attributes(
|
|
173
|
+
metadata={
|
|
174
|
+
**base_spec.metadata,
|
|
175
|
+
"source": stream_definition.get("source"),
|
|
176
|
+
"target": stream_definition.get("target")
|
|
177
|
+
}
|
|
178
|
+
)
|
|
179
|
+
"""
|
|
147
180
|
return self._base_translator.get_asset_spec(stream_definition)
|
|
148
181
|
|
|
149
182
|
def build_asset(
|
|
@@ -168,12 +201,41 @@ class SlingReplicationCollectionComponent(Component, Resolvable):
|
|
|
168
201
|
|
|
169
202
|
return _asset
|
|
170
203
|
|
|
204
|
+
@public
|
|
171
205
|
def execute(
|
|
172
206
|
self,
|
|
173
207
|
context: AssetExecutionContext,
|
|
174
208
|
sling: SlingResource,
|
|
175
209
|
replication_spec_model: SlingReplicationSpecModel,
|
|
176
210
|
) -> Iterator[Union[AssetMaterialization, MaterializeResult]]:
|
|
211
|
+
"""Executes a Sling replication for the selected streams.
|
|
212
|
+
|
|
213
|
+
This method can be overridden in a subclass to customize the replication execution
|
|
214
|
+
behavior, such as adding custom logging, modifying metadata collection, or handling
|
|
215
|
+
results differently.
|
|
216
|
+
|
|
217
|
+
Args:
|
|
218
|
+
context: The asset execution context provided by Dagster
|
|
219
|
+
sling: The SlingResource used to execute the replication
|
|
220
|
+
replication_spec_model: The model containing replication configuration and metadata options
|
|
221
|
+
|
|
222
|
+
Yields:
|
|
223
|
+
AssetMaterialization or MaterializeResult events from the Sling replication
|
|
224
|
+
|
|
225
|
+
Example:
|
|
226
|
+
Override this method to add custom logging during replication:
|
|
227
|
+
|
|
228
|
+
.. code-block:: python
|
|
229
|
+
|
|
230
|
+
from dagster_sling import SlingReplicationCollectionComponent
|
|
231
|
+
from dagster import AssetExecutionContext
|
|
232
|
+
|
|
233
|
+
class CustomSlingComponent(SlingReplicationCollectionComponent):
|
|
234
|
+
def execute(self, context, sling, replication_spec_model):
|
|
235
|
+
context.log.info("Starting Sling replication")
|
|
236
|
+
yield from super().execute(context, sling, replication_spec_model)
|
|
237
|
+
context.log.info("Sling replication completed")
|
|
238
|
+
"""
|
|
177
239
|
iterator = sling.replicate(context=context)
|
|
178
240
|
if "column_metadata" in replication_spec_model.include_metadata:
|
|
179
241
|
iterator = iterator.fetch_column_metadata()
|
|
@@ -2,7 +2,7 @@ from collections.abc import Iterable, Mapping
|
|
|
2
2
|
from dataclasses import dataclass
|
|
3
3
|
from typing import Any, Callable, Optional
|
|
4
4
|
|
|
5
|
-
from dagster import AssetKey, AssetSpec, AutoMaterializePolicy,
|
|
5
|
+
from dagster import AssetKey, AssetSpec, AutoMaterializePolicy, MetadataValue
|
|
6
6
|
from dagster._annotations import public, superseded
|
|
7
7
|
from dagster._utils.names import clean_name_lower_with_dots
|
|
8
8
|
from dagster._utils.warnings import supersession_warning
|
|
@@ -42,9 +42,6 @@ class DagsterSlingTranslator:
|
|
|
42
42
|
group_name=self._resolve_back_compat_method(
|
|
43
43
|
"get_group_name", self._default_group_name_fn, stream_definition
|
|
44
44
|
),
|
|
45
|
-
legacy_freshness_policy=self._resolve_back_compat_method(
|
|
46
|
-
"get_freshness_policy", self._default_freshness_policy_fn, stream_definition
|
|
47
|
-
),
|
|
48
45
|
auto_materialize_policy=self._resolve_back_compat_method(
|
|
49
46
|
"get_auto_materialize_policy",
|
|
50
47
|
self._default_auto_materialize_policy_fn,
|
|
@@ -465,58 +462,6 @@ class DagsterSlingTranslator:
|
|
|
465
462
|
meta = config.get("meta", {})
|
|
466
463
|
return meta.get("dagster", {}).get("group")
|
|
467
464
|
|
|
468
|
-
@superseded(
|
|
469
|
-
additional_warn_text="Use `DagsterSlingTranslator.get_asset_spec(...).freshness_policy` instead.",
|
|
470
|
-
)
|
|
471
|
-
@public
|
|
472
|
-
def get_freshness_policy(
|
|
473
|
-
self, stream_definition: Mapping[str, Any]
|
|
474
|
-
) -> Optional[LegacyFreshnessPolicy]:
|
|
475
|
-
"""Retrieves the freshness policy for a given stream definition.
|
|
476
|
-
|
|
477
|
-
This method checks the provided stream definition for a specific configuration
|
|
478
|
-
indicating a freshness policy. If the configuration is found, it constructs and
|
|
479
|
-
returns a FreshnessPolicy object based on the provided parameters. Otherwise,
|
|
480
|
-
it returns None.
|
|
481
|
-
|
|
482
|
-
Parameters:
|
|
483
|
-
stream_definition (Mapping[str, Any]): A dictionary representing the stream definition,
|
|
484
|
-
which includes configuration details.
|
|
485
|
-
|
|
486
|
-
Returns:
|
|
487
|
-
Optional[FreshnessPolicy]: A FreshnessPolicy object if the configuration is found,
|
|
488
|
-
otherwise None.
|
|
489
|
-
"""
|
|
490
|
-
return self._default_freshness_policy_fn(stream_definition)
|
|
491
|
-
|
|
492
|
-
def _default_freshness_policy_fn(
|
|
493
|
-
self, stream_definition: Mapping[str, Any]
|
|
494
|
-
) -> Optional[LegacyFreshnessPolicy]:
|
|
495
|
-
"""Retrieves the freshness policy for a given stream definition.
|
|
496
|
-
|
|
497
|
-
This method checks the provided stream definition for a specific configuration
|
|
498
|
-
indicating a freshness policy. If the configuration is found, it constructs and
|
|
499
|
-
returns a FreshnessPolicy object based on the provided parameters. Otherwise,
|
|
500
|
-
it returns None.
|
|
501
|
-
|
|
502
|
-
Parameters:
|
|
503
|
-
stream_definition (Mapping[str, Any]): A dictionary representing the stream definition,
|
|
504
|
-
which includes configuration details.
|
|
505
|
-
|
|
506
|
-
Returns:
|
|
507
|
-
Optional[FreshnessPolicy]: A FreshnessPolicy object if the configuration is found,
|
|
508
|
-
otherwise None.
|
|
509
|
-
"""
|
|
510
|
-
config = stream_definition.get("config", {}) or {}
|
|
511
|
-
meta = config.get("meta", {})
|
|
512
|
-
freshness_policy_config = meta.get("dagster", {}).get("freshness_policy")
|
|
513
|
-
if freshness_policy_config:
|
|
514
|
-
return LegacyFreshnessPolicy(
|
|
515
|
-
maximum_lag_minutes=float(freshness_policy_config["maximum_lag_minutes"]),
|
|
516
|
-
cron_schedule=freshness_policy_config.get("cron_schedule"),
|
|
517
|
-
cron_schedule_timezone=freshness_policy_config.get("cron_schedule_timezone"),
|
|
518
|
-
)
|
|
519
|
-
|
|
520
465
|
@superseded(
|
|
521
466
|
additional_warn_text="Use `DagsterSlingTranslator.get_asset_spec(...).auto_materialize_policy` instead.",
|
|
522
467
|
)
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "0.28.0"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: dagster-sling
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.28.0
|
|
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.
|
|
18
|
+
Requires-Dist: dagster==1.12.0
|
|
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.
|
|
38
|
+
"dagster==1.12.0",
|
|
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.15"
|
|
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
|