feat(status): add REUSED to Status enum for dbt State v1.11+ - #2316
feat(status): add REUSED to Status enum for dbt State v1.11+#2316zerafachris wants to merge 1 commit into
Conversation
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 |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughThe ChangesReused status support
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related issues
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
Summary
REUSED = "reused"to theStatusenum inelementary/monitor/data_monitoring/schema.py"reused"run status for models that are skipped because their state has not changedValueError: 'reused' is not a valid Statuswhen constructing alert objects from those run results, crashing the monitoring runBehaviour after this fix
The alert object is created without error. The default status filter (
FAIL/ERROR/RUNTIME_ERROR/WARN) correctly excludesREUSEDalerts 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 thatfilter_alertsno longer raisesValueErrorfor a"reused"status, and that the alert is correctly excluded by the default filterFixes #2311.
Summary by CodeRabbit
New Features
reusedstatus in monitoring alerts.Bug Fixes
reusedstatus are handled without errors and excluded from default status-filtered results.