dagster-sling 0.26.13__tar.gz → 0.26.15__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.26.13 → dagster_sling-0.26.15}/LICENSE +1 -1
- {dagster_sling-0.26.13/dagster_sling.egg-info → dagster_sling-0.26.15}/PKG-INFO +2 -2
- {dagster_sling-0.26.13 → dagster_sling-0.26.15}/dagster_sling/asset_decorator.py +13 -7
- {dagster_sling-0.26.13 → dagster_sling-0.26.15}/dagster_sling/components/sling_replication_collection/component.py +37 -56
- {dagster_sling-0.26.13 → dagster_sling-0.26.15}/dagster_sling/components/sling_replication_collection/scaffolder.py +3 -4
- dagster_sling-0.26.15/dagster_sling/version.py +1 -0
- {dagster_sling-0.26.13 → dagster_sling-0.26.15/dagster_sling.egg-info}/PKG-INFO +2 -2
- {dagster_sling-0.26.13 → dagster_sling-0.26.15}/dagster_sling.egg-info/requires.txt +1 -1
- {dagster_sling-0.26.13 → dagster_sling-0.26.15}/setup.py +1 -1
- dagster_sling-0.26.13/dagster_sling/version.py +0 -1
- {dagster_sling-0.26.13 → dagster_sling-0.26.15}/MANIFEST.in +0 -0
- {dagster_sling-0.26.13 → dagster_sling-0.26.15}/README.md +0 -0
- {dagster_sling-0.26.13 → dagster_sling-0.26.15}/dagster_sling/__init__.py +0 -0
- {dagster_sling-0.26.13 → dagster_sling-0.26.15}/dagster_sling/asset_defs.py +0 -0
- {dagster_sling-0.26.13 → dagster_sling-0.26.15}/dagster_sling/components/__init__.py +0 -0
- {dagster_sling-0.26.13 → dagster_sling-0.26.15}/dagster_sling/components/sling_replication_collection/__init__.py +0 -0
- {dagster_sling-0.26.13 → dagster_sling-0.26.15}/dagster_sling/dagster_sling_translator.py +0 -0
- {dagster_sling-0.26.13 → dagster_sling-0.26.15}/dagster_sling/py.typed +0 -0
- {dagster_sling-0.26.13 → dagster_sling-0.26.15}/dagster_sling/resources.py +0 -0
- {dagster_sling-0.26.13 → dagster_sling-0.26.15}/dagster_sling/sling_event_iterator.py +0 -0
- {dagster_sling-0.26.13 → dagster_sling-0.26.15}/dagster_sling/sling_replication.py +0 -0
- {dagster_sling-0.26.13 → dagster_sling-0.26.15}/dagster_sling.egg-info/SOURCES.txt +0 -0
- {dagster_sling-0.26.13 → dagster_sling-0.26.15}/dagster_sling.egg-info/dependency_links.txt +0 -0
- {dagster_sling-0.26.13 → dagster_sling-0.26.15}/dagster_sling.egg-info/entry_points.txt +0 -0
- {dagster_sling-0.26.13 → dagster_sling-0.26.15}/dagster_sling.egg-info/not-zip-safe +0 -0
- {dagster_sling-0.26.13 → dagster_sling-0.26.15}/dagster_sling.egg-info/top_level.txt +0 -0
- {dagster_sling-0.26.13 → dagster_sling-0.26.15}/integration.yaml +0 -0
- {dagster_sling-0.26.13 → dagster_sling-0.26.15}/setup.cfg +0 -0
|
@@ -186,7 +186,7 @@
|
|
|
186
186
|
same "printed page" as the copyright notice for easier
|
|
187
187
|
identification within third-party archives.
|
|
188
188
|
|
|
189
|
-
Copyright
|
|
189
|
+
Copyright 2025 Dagster Labs, Inc.
|
|
190
190
|
|
|
191
191
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
192
|
you may not use this file except in compliance with the License.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: dagster-sling
|
|
3
|
-
Version: 0.26.
|
|
3
|
+
Version: 0.26.15
|
|
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
|
|
@@ -14,7 +14,7 @@ Classifier: License :: OSI Approved :: Apache Software License
|
|
|
14
14
|
Classifier: Operating System :: OS Independent
|
|
15
15
|
Requires-Python: >=3.9,<3.13
|
|
16
16
|
License-File: LICENSE
|
|
17
|
-
Requires-Dist: dagster==1.10.
|
|
17
|
+
Requires-Dist: dagster==1.10.15
|
|
18
18
|
Requires-Dist: sling>=1.1.5
|
|
19
19
|
Requires-Dist: sling-mac-arm64; platform_system == "Darwin" and platform_machine == "arm64"
|
|
20
20
|
Provides-Extra: test
|
|
@@ -9,6 +9,7 @@ from dagster import (
|
|
|
9
9
|
_check as check,
|
|
10
10
|
multi_asset,
|
|
11
11
|
)
|
|
12
|
+
from dagster._core.definitions.asset_spec import AssetSpec
|
|
12
13
|
from dagster._utils.merger import deep_merge_dicts
|
|
13
14
|
from dagster._utils.security import non_secure_md5_hash_str
|
|
14
15
|
|
|
@@ -118,6 +119,11 @@ def sling_assets(
|
|
|
118
119
|
or DagsterSlingTranslator()
|
|
119
120
|
)
|
|
120
121
|
|
|
122
|
+
def update_code_version_if_unset_by_translator(asset_spec: AssetSpec) -> AssetSpec:
|
|
123
|
+
if asset_spec.code_version is None:
|
|
124
|
+
return asset_spec.replace_attributes(code_version=code_version)
|
|
125
|
+
return asset_spec
|
|
126
|
+
|
|
121
127
|
return multi_asset(
|
|
122
128
|
name=name,
|
|
123
129
|
partitions_def=partitions_def,
|
|
@@ -125,13 +131,13 @@ def sling_assets(
|
|
|
125
131
|
op_tags=op_tags,
|
|
126
132
|
backfill_policy=backfill_policy,
|
|
127
133
|
specs=[
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
134
|
+
update_code_version_if_unset_by_translator(
|
|
135
|
+
dagster_sling_translator.get_asset_spec(stream).merge_attributes(
|
|
136
|
+
metadata={
|
|
137
|
+
METADATA_KEY_TRANSLATOR: dagster_sling_translator,
|
|
138
|
+
METADATA_KEY_REPLICATION_CONFIG: replication_config,
|
|
139
|
+
}
|
|
140
|
+
)
|
|
135
141
|
)
|
|
136
142
|
for stream in streams
|
|
137
143
|
],
|
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
from collections.abc import Iterator, Mapping, Sequence
|
|
2
2
|
from dataclasses import dataclass, field
|
|
3
|
+
from functools import cached_property
|
|
3
4
|
from pathlib import Path
|
|
4
|
-
from typing import Annotated, Any, Literal, Optional, Union
|
|
5
|
+
from typing import Annotated, Any, Callable, Literal, Optional, Union
|
|
5
6
|
|
|
6
7
|
from dagster._core.definitions.asset_spec import AssetSpec
|
|
7
8
|
from dagster._core.definitions.assets import AssetsDefinition
|
|
8
|
-
from dagster._core.definitions.declarative_automation.automation_condition import (
|
|
9
|
-
AutomationCondition,
|
|
10
|
-
)
|
|
11
9
|
from dagster._core.definitions.definitions_class import Definitions
|
|
12
10
|
from dagster._core.definitions.events import AssetMaterialization
|
|
13
11
|
from dagster._core.definitions.result import MaterializeResult
|
|
@@ -30,72 +28,55 @@ from dagster_sling.resources import AssetExecutionContext, SlingResource
|
|
|
30
28
|
SlingMetadataAddons: TypeAlias = Literal["column_metadata", "row_count"]
|
|
31
29
|
|
|
32
30
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
31
|
+
def resolve_translation(context: ResolutionContext, model):
|
|
32
|
+
info = TranslatorResolvingInfo(
|
|
33
|
+
"stream_definition",
|
|
34
|
+
asset_attributes=model,
|
|
35
|
+
resolution_context=context,
|
|
36
|
+
model_key="translation",
|
|
37
|
+
)
|
|
38
|
+
return lambda base_asset_spec, stream_definition: info.get_asset_spec(
|
|
39
|
+
base_asset_spec,
|
|
40
|
+
{
|
|
41
|
+
"stream_definition": stream_definition,
|
|
42
|
+
"spec": base_asset_spec,
|
|
43
|
+
},
|
|
44
|
+
)
|
|
37
45
|
|
|
38
|
-
def get_automation_condition(
|
|
39
|
-
self, stream_definition: Mapping[str, Any]
|
|
40
|
-
) -> Optional[AutomationCondition]: ...
|
|
41
|
-
|
|
42
|
-
def get_asset_spec(self, stream_definition: Mapping[str, Any]) -> AssetSpec:
|
|
43
|
-
asset_spec = super().get_asset_spec(stream_definition)
|
|
44
|
-
return asset_spec.replace_attributes(
|
|
45
|
-
automation_condition=self.get_automation_condition(stream_definition)
|
|
46
|
-
)
|
|
47
46
|
|
|
47
|
+
TranslationFn: TypeAlias = Callable[[AssetSpec, Mapping[str, Any]], AssetSpec]
|
|
48
48
|
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
49
|
+
ResolvedTranslationFn: TypeAlias = Annotated[
|
|
50
|
+
TranslationFn,
|
|
51
|
+
Resolver(
|
|
52
|
+
resolve_translation,
|
|
53
|
+
model_field_type=Union[str, AssetAttributesModel],
|
|
54
|
+
),
|
|
55
|
+
]
|
|
53
56
|
|
|
54
|
-
def get_asset_spec(self, obj: Any) -> AssetSpec: # pyright: ignore[reportIncompatibleMethodOverride]
|
|
55
|
-
base_spec = super().get_asset_spec(obj)
|
|
56
|
-
return self.resolving_info.get_asset_spec(
|
|
57
|
-
base_spec,
|
|
58
|
-
{self.resolving_info.obj_name: obj, "spec": base_spec},
|
|
59
|
-
)
|
|
60
57
|
|
|
58
|
+
class ProxyDagsterSlingTranslator(DagsterSlingTranslator):
|
|
59
|
+
def __init__(self, fn: TranslationFn):
|
|
60
|
+
self._fn = fn
|
|
61
61
|
|
|
62
|
-
def
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
) -> DagsterSlingTranslator:
|
|
66
|
-
# TODO: Consider supporting owners and code_version in the future
|
|
67
|
-
if asset_attributes and isinstance(asset_attributes, AssetAttributesModel):
|
|
68
|
-
set_vals = asset_attributes.model_dump(exclude_unset=True)
|
|
69
|
-
if "owners" in set_vals:
|
|
70
|
-
raise ValueError("owners are not supported for sling_replication_collection component")
|
|
71
|
-
if "code_version" in set_vals:
|
|
72
|
-
raise ValueError(
|
|
73
|
-
"code_version is not supported for sling_replication_collection component"
|
|
74
|
-
)
|
|
75
|
-
|
|
76
|
-
return ComponentsDagsterSlingTranslator(
|
|
77
|
-
resolving_info=TranslatorResolvingInfo(
|
|
78
|
-
"stream_definition",
|
|
79
|
-
asset_attributes or AssetAttributesModel(),
|
|
80
|
-
context,
|
|
81
|
-
)
|
|
82
|
-
)
|
|
62
|
+
def get_asset_spec(self, stream_definition: Mapping[str, Any]) -> AssetSpec:
|
|
63
|
+
base_asset_spec = super().get_asset_spec(stream_definition)
|
|
64
|
+
return self._fn(base_asset_spec, stream_definition)
|
|
83
65
|
|
|
84
66
|
|
|
85
67
|
@dataclass
|
|
86
68
|
class SlingReplicationSpecModel(Resolvable):
|
|
87
69
|
path: str
|
|
88
70
|
op: Optional[OpSpec] = None
|
|
89
|
-
|
|
90
|
-
Optional[DagsterSlingTranslator],
|
|
91
|
-
Resolver(
|
|
92
|
-
resolve_translator,
|
|
93
|
-
model_field_name="asset_attributes",
|
|
94
|
-
model_field_type=Union[str, AssetAttributesModel],
|
|
95
|
-
),
|
|
96
|
-
] = None
|
|
71
|
+
translation: Optional[ResolvedTranslationFn] = None
|
|
97
72
|
include_metadata: list[SlingMetadataAddons] = field(default_factory=list)
|
|
98
73
|
|
|
74
|
+
@cached_property
|
|
75
|
+
def translator(self):
|
|
76
|
+
if self.translation:
|
|
77
|
+
return ProxyDagsterSlingTranslator(self.translation)
|
|
78
|
+
return DagsterSlingTranslator()
|
|
79
|
+
|
|
99
80
|
|
|
100
81
|
def resolve_resource(
|
|
101
82
|
context: ResolutionContext,
|
|
@@ -1,12 +1,11 @@
|
|
|
1
|
-
from typing import Any
|
|
2
|
-
|
|
3
1
|
import yaml
|
|
4
|
-
from dagster.components.component.component_scaffolder import Scaffolder
|
|
2
|
+
from dagster.components.component.component_scaffolder import Scaffolder
|
|
5
3
|
from dagster.components.component_scaffolding import scaffold_component
|
|
4
|
+
from dagster.components.scaffold.scaffold import ScaffoldRequest
|
|
6
5
|
|
|
7
6
|
|
|
8
7
|
class SlingReplicationComponentScaffolder(Scaffolder):
|
|
9
|
-
def scaffold(self, request: ScaffoldRequest
|
|
8
|
+
def scaffold(self, request: ScaffoldRequest) -> None:
|
|
10
9
|
scaffold_component(request, {"replications": [{"path": "replication.yaml"}]})
|
|
11
10
|
replication_path = request.target_path / "replication.yaml"
|
|
12
11
|
with open(replication_path, "w") as f:
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "0.26.15"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: dagster-sling
|
|
3
|
-
Version: 0.26.
|
|
3
|
+
Version: 0.26.15
|
|
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
|
|
@@ -14,7 +14,7 @@ Classifier: License :: OSI Approved :: Apache Software License
|
|
|
14
14
|
Classifier: Operating System :: OS Independent
|
|
15
15
|
Requires-Python: >=3.9,<3.13
|
|
16
16
|
License-File: LICENSE
|
|
17
|
-
Requires-Dist: dagster==1.10.
|
|
17
|
+
Requires-Dist: dagster==1.10.15
|
|
18
18
|
Requires-Dist: sling>=1.1.5
|
|
19
19
|
Requires-Dist: sling-mac-arm64; platform_system == "Darwin" and platform_machine == "arm64"
|
|
20
20
|
Provides-Extra: test
|
|
@@ -34,7 +34,7 @@ setup(
|
|
|
34
34
|
include_package_data=True,
|
|
35
35
|
python_requires=">=3.9,<3.13",
|
|
36
36
|
install_requires=[
|
|
37
|
-
"dagster==1.10.
|
|
37
|
+
"dagster==1.10.15",
|
|
38
38
|
"sling>=1.1.5",
|
|
39
39
|
# Required due to a bug in uv that can cause sling-linux-amd64 to be installed instead.
|
|
40
40
|
# See: https://github.com/astral-sh/uv/issues/10945
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
__version__ = "0.26.13"
|
|
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
|