Skip to content

feat(integrations/dagster): add RockyResource.cost() method + fixture#218

Merged
hugocorreia90 merged 1 commit intomainfrom
feat/dagster-rocky-cost-method
Apr 22, 2026
Merged

feat(integrations/dagster): add RockyResource.cost() method + fixture#218
hugocorreia90 merged 1 commit intomainfrom
feat/dagster-rocky-cost-method

Conversation

@hugocorreia90
Copy link
Copy Markdown
Contributor

Summary

  • Adds RockyResource.cost(run_id="latest") — shells out to rocky cost <target> and returns the generated CostOutput Pydantic model. Mirrors the shape of the sibling observability methods (history, optimize, doctor).
  • Wires CostOutput / PerModelCostHistorical through the types_generated barrel and types.py, registers CostOutput in the RockyOutput union and the parse_rocky_output dispatch under the "cost" command literal.
  • Extends scripts/regen_fixtures.sh with a capture cost cost latest step (the existing bootstrap rocky run persists the RunRecord the new command rolls up). fixtures_generated/cost.json is committed; the fixture is deterministic through the existing normalizer.
  • test_generated_fixtures.py::EXPECTED_TYPES maps "cost" → CostOutput so the parse-guard covers the new live-binary capture.
  • Finishes the follow-up explicitly deferred in engine PR feat(engine): Trust-system Arc 2 wave 2 — rocky cost <run_id|latest> #202; the Pydantic type was already generated in that PR but wasn't reachable via the resource or parse_rocky_output.

Follow-ups not included here (matches the task spec of a single run_id arg):

  • --model filter pass-through (CLI flag already exists; add when a caller needs it).

Test plan

  • uv run pytest -v from integrations/dagster/ — 312 tests pass locally
  • uv run ruff check src/ tests/ and uv run ruff format --check src/ tests/ clean
  • just regen-fixtures from the monorepo root produces a stable fixtures_generated/cost.json
  • test_generated_fixtures.py::test_generated_fixture_parses[cost.json] passes against the captured fixture
  • test_cost_defaults_to_latest + test_cost_passes_explicit_run_id cover the happy path

Wires the `rocky cost <run_id|latest>` CLI (shipped in engine PR #202) into
the Dagster integration. Adds a `RockyResource.cost(run_id="latest")` method
that shells out and returns the generated `CostOutput` Pydantic model, plus a
unit test for the happy path (default and explicit run_id) and a live-binary
fixture captured from the playground POC.

- Re-exports `CostOutput` + `PerModelCostHistorical` from `types_generated`
  and `types.py`, registers `CostOutput` in the `RockyOutput` union and the
  `parse_rocky_output` dispatch under the `"cost"` command literal.
- `scripts/regen_fixtures.sh` now captures `fixtures_generated/cost.json`
  (the bootstrap `rocky run` at the top of the script already persists the
  RunRecord that `rocky cost latest` rolls up).
- `test_generated_fixtures.py::EXPECTED_TYPES` maps `"cost"` → `CostOutput`
  so the parse-guard covers the new fixture.
@hugocorreia90 hugocorreia90 merged commit 8d175ed into main Apr 22, 2026
9 checks passed
@hugocorreia90 hugocorreia90 deleted the feat/dagster-rocky-cost-method branch April 22, 2026 12:18
hugocorreia90 added a commit that referenced this pull request Apr 22, 2026
* chore: release engine-v1.14.0 + dagster-v1.10.0 + vscode-v1.6.4

Bumps all three artifacts to cover the 16-PR cascade since engine-v1.13.0
/ dagster-v1.9.0 / vscode-v1.6.3. Details in each CHANGELOG.

Engine headlines (12 PRs):
- Arc 7 wave 2 wave-2 complete — cached DESCRIBE end-to-end
  (#223 infra, #228 reads, #230 write tap, #231 discover warm-up,
  #232 state controls + --cache-ttl override)
- Arc 2 wave 3 complete — bytes_scanned / bytes_written on
  MaterializationOutput (#219 BQ, #221 Databricks, #220 Snowflake
  deferred doc, #222 docstring cascade). Real $ on rocky cost for
  BQ + Databricks
- FR-005 Unity Catalog workspace-binding reconcile (#226)
- FR-002 Fivetran connector metadata via SourceOutput.metadata (#225)
- Housekeeping: compute_backoff dedup into rocky_core::retry (#217)

Dagster headlines (4 PRs):
- FR-001 RockyComponent Pipes execution mode + FR-006 strict doctor
  on RockyResource startup (#224)
- FR-003 RockyResource.state_health() (#227) + FR follow-up threading
  doctor(check=state_rw) for sub-second probes (#229)
- RockyResource.cost() wiring + fixture (#218)

VS Code: regenerated TS bindings for engine 1.14.0 type additions.
No extension feature changes.

* chore(integrations/dagster): regenerate test fixtures for engine 1.14.0

36 fixtures picked up the new engine version string in their top-level
"version" field. No schema changes — just the version bump.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant