Skip to content

feat(status): add REUSED to Status enum for dbt State v1.11+ - #2316

Open
zerafachris wants to merge 1 commit into
elementary-data:masterfrom
zerafachris:master
Open

feat(status): add REUSED to Status enum for dbt State v1.11+#2316
zerafachris wants to merge 1 commit into
elementary-data:masterfrom
zerafachris:master

Conversation

@zerafachris

@zerafachris zerafachris commented Aug 6, 2026

Copy link
Copy Markdown

Summary

  • Adds REUSED = "reused" to the Status enum in elementary/monitor/data_monitoring/schema.py
  • dbt State (v1.11+) introduced a "reused" run status for models that are skipped because their state has not changed
  • Without this fix, elementary raises ValueError: 'reused' is not a valid Status when constructing alert objects from those run results, crashing the monitoring run

Behaviour after this fix

The alert object is created without error. The default status filter (FAIL / ERROR / RUNTIME_ERROR / WARN) correctly excludes REUSED alerts from notifications — matching dbt's intent that a reused model is not an actionable event.

Test plan

  • tests/unit/monitor/api/alerts/test_alert_filters.py::test_reused_status_does_not_crash_filter_alerts — new regression test verifying that filter_alerts no longer raises ValueError for a "reused" status, and that the alert is correctly excluded by the default filter
  • Existing alert filter test suite passes unchanged

Fixes #2311.

Summary by CodeRabbit

  • New Features

    • Added support for recognizing the reused status in monitoring alerts.
  • Bug Fixes

    • Improved alert filtering so alerts with the reused status are handled without errors and excluded from default status-filtered results.

dbt State (v1.11+) introduces a "reused" run status for models that
are skipped because their state has not changed. This caused a
ValueError when elementary tried to construct alert objects from those
run results, since "reused" was not a member of the Status enum.

Adding REUSED = "reused" lets alert objects be created normally; the
default status filter (FAIL/ERROR/RUNTIME_ERROR/WARN) correctly
excludes "reused" alerts from notifications, matching dbt's intent
that a reused model is not an actionable event.

Fixes elementary-data#2311.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@zerafachris
zerafachris requested a deployment to elementary_test_env August 6, 2026 12:41 — with GitHub Actions Waiting
@github-actions

github-actions Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

👋 @zerafachris
Thank you for raising your pull request.
Please make sure to add tests and document all user-facing changes.
You can do this by editing the docs files in this pull request.

@coderabbitai

coderabbitai Bot commented Aug 6, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 87e32f60-c136-4e94-a783-696d8b7ec9f7

📥 Commits

Reviewing files that changed from the base of the PR and between 594b89d and d0ec267.

📒 Files selected for processing (2)
  • elementary/monitor/data_monitoring/schema.py
  • tests/unit/monitor/api/alerts/test_alert_filters.py

📝 Walkthrough

Walkthrough

The Status enum now supports dbt’s "reused" status. A regression test verifies that alert filtering excludes reused alerts without raising an exception.

Changes

Reused status support

Layer / File(s) Summary
Add the reused status
elementary/monitor/data_monitoring/schema.py
Adds Status.REUSED with the serialized value "reused".
Cover reused alert filtering
tests/unit/monitor/api/alerts/test_alert_filters.py
Verifies that reused alerts are excluded from default filtering without raising ValueError and map to Status.REUSED.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related issues

  • elementary-data/elementary#2311 — Adds Status.REUSED to prevent CLI failures when filtering alerts with dbt’s "reused" status.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly identifies the addition of the REUSED status for dbt State v1.11+ and matches the primary change.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

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.

dbt State introduces new model Status "reused" that breaks edr CLI commands

1 participant