Generate your anomaly test with Elementary AI
Let our Slack chatbot create the anomaly test you need.
elementary.execution_sla
Verifies that dbt models are executed successfully before a specified SLA deadline time.
This test checks whether your pipeline completed before a specified deadline on the days you care about. It queries dbt_run_results for successful runs of the model and validates that at least one run completed before the SLA deadline.
Use Case
“Did my pipeline complete before 7 AM Pacific on the days I care about?”Test Logic
- If today is not a scheduled check day → PASS (skip)
- Query
dbt_run_resultsfor successful runs of the model today - If any run completed before the SLA deadline → PASS
- If SLA deadline hasn’t passed yet → PASS (still time)
- If model ran but after deadline → FAIL (MISSED_SLA)
- If all runs failed → FAIL (ALL_FAILED)
- If model didn’t run today → FAIL (NOT_RUN)
Test configuration
Required configuration:sla_time, timezone
data_tests:
— elementary.execution_sla:
arguments:
sla_time: string # Required - e.g., “07:00”, “7am”, “2:30pm”, “14:30”
timezone: string # Required - IANA timezone name, e.g., “America/Los_Angeles”, “Europe/Amsterdam”
day_of_week: string | array # Optional - Day(s) to check: “Monday” or [“Monday”, “Wednesday”]
day_of_month: int | array # Optional - Day(s) of month to check: 1 or [1, 15]
Features
- Flexible time formats: Supports
"07:00","7am","2:30pm","14:30", and other common formats - IANA timezone support: Uses standard timezone names like
"America/Los_Angeles","Europe/Amsterdam", etc. - Automatic DST handling: Uses
pytzfor timezone conversions with automatic daylight saving time handling - Database-agnostic: All timezone logic happens at compile time
- Schedule filters: Optional
day_of_weekandday_of_monthparameters to check only specific days
Parameters
| Parameter | Required | Description |
|---|---|---|
sla_time | Yes | Deadline time (e.g., "07:00", "7am", "2:30pm") |
timezone | Yes | IANA timezone name (e.g., "America/Los_Angeles") |
day_of_week | No | Day(s) to check: "Monday" or ["Monday", "Wednesday"] |
day_of_month | No | Day(s) of month to check: 1 or [1, 15] |
Notes
- This test only works with models, not sources
- The test automatically skips on non-scheduled days (when
day_of_weekorday_of_monthfilters are set) - If both
day_of_weekandday_of_monthare set, the test uses OR logic (checks if either matches) - The test passes if the SLA deadline hasn’t been reached yet, giving your pipeline time to complete

