dagster-rocky
Dagster integration for Rocky, the typed graph between your code and your warehouse.
dagster-rocky runs the rocky binary from a Dagster ConfigurableResource and exposes Rocky-managed tables as materializable assets. It is a thin adapter over the rocky-sdk client.
┌──────────────────┐ selected assets ┌───────────────────────────┐
│ Dagster run │──────────────────►│ RockyComponent, or your │
│ (materialize) │ become a filter │ own asset + RockyResource │
└──────────────────┘ └─────────────┬─────────────┘
│ argv
▼
┌────────────────────────────┐
│ rocky run --filter k=v │──► warehouse
│ --output json │◄── rows
└───────┬───────────┬────────┘
stderr lines │ │ stdout JSON
▼ ▼
context.log.info RunResult
(via run_streaming) (the component turns
it into Dagster events)
What Rocky output becomes in Dagster
These mappings describe RockyComponent on the default
execution_mode = "streaming" path. The pipes mode reports over the Pipes
wire, and dag_mode emits through its own path.
| Rocky output | Dagster shape | Fires when |
|---|---|---|
| a copied table | MaterializeResult |
on by default |
| quality check results | AssetCheckResult |
on by default |
| schema drift | AssetObservation |
on by default |
| contract violations | AssetCheckResult |
you set contracts_dir |
| column-level lineage | TableColumnLineage metadata |
you set surface_column_lineage: true |
| per-model cost recommendations | AssetSpec metadata |
surface_optimize_metadata (on by default), models_dir exists, and rocky optimize has run history to analyze |
Without the component, emit_materializations() does the first row: it returns AssetMaterialization events for context.log_event.
- Check severity carries across. A check Rocky marks
warningemitsWARNwhen it fails.WARNdoes not degrade asset health. - Failure containment shows on the timeline.
contain_failuresunder[resilience]inrocky.tomldefaults totrue(falseis fail-fast). Rocky then withholds the models behind a failed upstream instead of failing the run. Each withheld model gets anAssetObservationnaming the blocker. Only the defaultexecution_mode = "streaming"emits these, notpipesordag_mode.
Install
uv add dagster-rocky
You'll also need the Rocky CLI on your $PATH:
https://github.com/rocky-data/rocky/releases?q=engine
Quick start (component)
Add a defs.yaml next to your other Dagster definitions:
type: dagster_rocky.RockyComponent
attributes:
binary_path: rocky
config_path: config/rocky.toml
models_dir: models
The component reads a cached state file, so write that file before you load the
definitions. The dg defs state refresh workflow calls write_state_to_path()
for you. A scheduled job that resolves the state path from the defs_state
config does the same.
That refresh is what calls Rocky. It runs rocky discover. It also runs
rocky compile and rocky optimize when models_dir exists on disk, and it
caches each result it gets.
Compile and optimize are best-effort for transport failures (missing binary, timeout): the refresh logs them and still writes the discovery state. A schema mismatch between dagster-rocky and the rocky binary raises dg.Failure, and no state is written.
Loading the definitions then reads that cached state:
- Build one subset-aware
multi_assetper Rocky group. Each table gets at least three declared checks:row_count,column_match, androw_count_anomaly. A fourth,freshness, is declared only when the pipeline configures[checks.freshness]. Contract rules fromcontracts_diradd more, and so dosurface_complianceandsurface_configured_checkswhen you turn them on. - Run
rocky run --filter <key>=<value>on materialization, for the selected subset only.
Without a state file the component loads no Rocky assets. Set
discover_on_missing_state: true and the loader runs that refresh itself the
first time, when state lives on the local filesystem. It skips that under
dg dev, where the refresh workflow above is the intended path.
Quick start (resource)
import dagster as dg
from dagster_rocky import RockyResource
rocky = RockyResource(
binary_path="rocky",
config_path="config/rocky.toml",
timeout_seconds=3600,
)
defs = dg.Definitions(resources={"rocky": rocky})
Then in an asset:
@dg.asset
def acme_orders(rocky: RockyResource) -> dg.MaterializeResult:
result = rocky.run("tenant=acme")
return dg.MaterializeResult(
metadata={"tables_copied": result.tables_copied, "duration_ms": result.duration_ms},
)
run() returns a RunResult. A partial failure returns a result rather than raising, so read result.errors. For a run longer than a few seconds, call run_streaming(context, filter), which forwards engine stderr to context.log.info live. RockyComponent uses it by default.
Public API
| Symbol | Purpose |
|---|---|
RockyResource |
ConfigurableResource wrapping the Rocky CLI |
RockyComponent |
State-backed Dagster component that loads Rocky tables as assets |
RockyDagsterTranslator |
Subclass to customize asset key / group / tag mapping |
RockyMetadataSet |
Namespaced metadata (source_id, strategy, watermark, …) |
load_rocky_assets() |
Functional helper that returns an AssetSpec for each enabled Rocky table |
emit_materializations() / emit_check_results() |
Convert a RunResult into Dagster events |
check_metadata() |
Build a metadata mapping for a single Rocky CheckResult |
cost_metadata_from_optimize() |
Extract per-model cost recommendations from OptimizeResult |
parse_rocky_output() |
Auto-detect a Rocky JSON payload and return the matching Pydantic model |
Documentation
- Dagster Integration docs: resource, component, translator, schedules, sensors, pipes, and more
- DEVELOPMENT.md: local setup, architecture, testing
- CHANGELOG.md: release notes
Related projects
- Rocky: the Rust SQL transformation engine
- rocky-sdk: the typed Python client this package is built on
- Rocky VS Code extension: VS Code extension with LSP and AI features
License
Apache 2.0
Metadata
Release files for dagster-rocky 1.75.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| dagster_rocky-1.75.0.tar.gz | 458.5 kB | With provenance | Details for dagster_rocky-1.75.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| dagster_rocky-1.75.0-py3-none-any.whl | Python 3 | none | any | Details for dagster_rocky-1.75.0-py3-none-any.whl |
Total release size: 612.9 kB
Release files / dagster_rocky-1.75.0.tar.gz
| Download URL | dagster_rocky-1.75.0.tar.gz |
|---|---|
| Size | 458.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d50c05d82540b23e585a1a2870e391e781e4603c30559cb8ffdb8eb89d9a4486
|
|
BLAKE2b-256 checksum How to use checksums |
df427e38982a0511d309e2f5c793453c442f0cd41d25089c2b344ed41d68fe95
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Dec 1, 2026.
Transparency logRelease files / dagster_rocky-1.75.0-py3-none-any.whl
| Download URL | dagster_rocky-1.75.0-py3-none-any.whl |
|---|---|
| Size | 154.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
4af2c6de1c814af9752cca58259a6f813f2320c1d47842912c3ede6a8e8aff3c
|
|
BLAKE2b-256 checksum How to use checksums |
ca835b4875184deedd4d8c14ca9a5a983985d6e75fbf29aa8ddecb2d87f0ba76
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Dec 1, 2026.
Transparency logSecurity for dagster-rocky 1.75.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for dagster_rocky-1.75.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Dec 1, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.