Skip to content

Commit 069954e

Browse files
authored
[dagster-spark] mark spark declarative pipelines as preview; add API doc references (#33665)
## Summary & Motivation Follow up to #33539 * Marks user-facing APIs as `preview` * Adds references to docs RST files ## Test Plan ## Changelog - [dagster-spark] Introduces Spark Declarative Pipeline support in feature preview
1 parent 9e80eb3 commit 069954e

7 files changed

Lines changed: 32 additions & 5 deletions

File tree

docs/docs/integrations/libraries/spark/index.md

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,14 @@ Dagster also provides native support for the new **Spark Declarative Pipelines (
4848
The `SparkDeclarativePipelineComponent` leverages the `spark-pipelines` CLI to automatically discover your datasets and dependencies using `spark-pipelines dry-run`.
4949

5050
**Key benefits include:**
51-
* **Auto-Discovery:** No need to manually define `AssetSpec`s. The component infers Materialized Views and Streaming Tables automatically at load time.
52-
* **Incremental & Full Refresh:** Natively supports both `--refresh` and `--full-refresh` execution modes.
53-
* **Real-time Observability:** Streams execution logs and events directly back to the Dagster UI during execution.
54-
* **UI Clutter Reduction:** Pipeline-scoped intermediate datasets (Temporary Views) are automatically filtered out from the Dagster lineage unless explicitly overridden.
51+
52+
- **Auto-Discovery:** No need to manually define `AssetSpec`s. The component infers Materialized Views and Streaming Tables automatically at load time.
53+
- **Incremental & Full Refresh:** Natively supports both `--refresh` and `--full-refresh` execution modes.
54+
- **Real-time Observability:** Streams execution logs and events directly back to the Dagster UI during execution.
55+
- **UI Clutter Reduction:** Pipeline-scoped intermediate datasets (Temporary Views) are automatically filtered out from the Dagster lineage unless explicitly overridden.
5556

5657
You can quickly initialize a new SDP component in your Dagster project using the `dg` CLI:
58+
5759
```bash
58-
dg scaffold component dagster_spark.SparkDeclarativePipelineComponent my_sdp_pipeline --pipeline-spec-path ./path/to/spark-pipeline.yml
60+
dg scaffold component dagster_spark.SparkDeclarativePipelineComponent my_sdp_pipeline --pipeline-spec-path ./path/to/spark-pipeline.yml
61+
```

docs/sphinx/sections/integrations/libraries/spark/dagster-spark.rst

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,19 @@ dagster-spark library
1111

1212
.. autofunction:: construct_spark_shell_command
1313

14+
Spark Declarative Pipelines
15+
===========================
16+
17+
.. autoclass:: SparkDeclarativePipelineComponent
18+
19+
.. currentmodule:: dagster_spark.components.spark_declarative_pipeline
20+
21+
.. autoclass:: SparkPipelinesResource
22+
23+
.. autoclass:: SparkDeclarativePipelineScaffolder
24+
25+
.. currentmodule:: dagster_spark
26+
1427
Legacy
1528
=======
1629

python_modules/libraries/dagster-spark/dagster_spark/components/spark_declarative_pipeline/component.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
import dagster as dg
1313
from dagster import AssetKey, AssetSpec, Definitions, deserialize_value, serialize_value
14+
from dagster._annotations import preview
1415
from dagster.components.component.state_backed_component import StateBackedComponent
1516
from dagster.components.core.context import ComponentLoadContext
1617
from dagster.components.resolved.core_models import OpSpec
@@ -50,6 +51,7 @@ def _resolve_spark_pipelines_resource(_context: Any, value: Any) -> SparkPipelin
5051
)
5152

5253

54+
@preview
5355
@scaffold_with(SparkDeclarativePipelineScaffolder)
5456
@dataclass
5557
class SparkDeclarativePipelineComponent(StateBackedComponent, dg.Resolvable):

python_modules/libraries/dagster-spark/dagster_spark/components/spark_declarative_pipeline/resource.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
from typing import Any, Literal
1212

1313
from dagster import AssetKey, ConfigurableResource
14+
from dagster._annotations import preview
1415
from pydantic import Field
1516

1617
from dagster_spark.components.spark_declarative_pipeline.discovery import (
@@ -23,6 +24,7 @@
2324
ExecutionMode = Literal["incremental", "full_refresh"]
2425

2526

27+
@preview
2628
class SparkPipelinesResource(ConfigurableResource):
2729
"""Dagster resource for Spark Declarative Pipelines: discovery and run.
2830

python_modules/libraries/dagster-spark/dagster_spark/components/spark_declarative_pipeline/scaffolder.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
"""Scaffolder for Spark Declarative Pipeline component."""
22

3+
from dagster._annotations import preview
34
from dagster.components.component.component_scaffolder import Scaffolder
45
from dagster.components.component_scaffolding import scaffold_component
56
from dagster.components.scaffold.scaffold import ScaffoldRequest
67

78

9+
@preview
810
class SparkDeclarativePipelineScaffolder(Scaffolder):
911
"""Scaffolds a Spark Declarative Pipeline component defs.yaml and pipeline spec path."""
1012

python_modules/libraries/dagster-spark/dagster_spark_tests/components/spark_declarative_pipeline/test_component.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
from unittest.mock import MagicMock
99

1010
import dagster as dg
11+
import pytest
1112
from dagster import AssetKey
1213
from dagster._utils.test.definitions import scoped_definitions_load_context
1314
from dagster.components.testing.utils import create_defs_folder_sandbox
@@ -17,6 +18,8 @@
1718
SparkPipelineState,
1819
)
1920

21+
pytestmark = pytest.mark.filterwarnings("ignore::dagster.PreviewWarning")
22+
2023

2124
@contextmanager
2225
def setup_spark_component(

python_modules/libraries/dagster-spark/dagster_spark_tests/components/spark_declarative_pipeline/test_resource.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
)
1010
from dagster_spark.components.spark_declarative_pipeline.resource import SparkPipelinesResource
1111

12+
pytestmark = pytest.mark.filterwarnings("ignore::dagster.PreviewWarning")
13+
1214

1315
def test_run_and_observe_completes_successfully_with_asset_keys() -> None:
1416
"""run_and_observe runs the subprocess and returns None; the asset yields MaterializeResults."""

0 commit comments

Comments
 (0)