models: - name: < model name > data_tests: - elementary.data_freshness_sla: arguments: timestamp_column: < column name > # Required sla_time: < deadline time > # Required - e.g., "07:00", "7am", "2:30pm" timezone: < IANA timezone > # Required - e.g., "America/Los_Angeles" day_of_week: < day or array > # Optional day_of_month: < day or array > # Optional where_expression: < sql expression > # Optional
Other Tests
data_freshness_sla
Generate your anomaly test with Elementary AI
Let our Slack chatbot create the anomaly test you need.
elementary.data_freshness_slaVerifies that data in a model was updated before a specified SLA deadline time.This test checks the maximum timestamp value of a specified column in your data to determine whether the data was actually refreshed before your deadline. Unlike freshness_anomalies (which uses z-score based anomaly detection as a dbt test, or ML-based detection in Elementary Cloud), this test validates against a fixed, explicit SLA time, making it ideal when you have a concrete contractual or operational deadline.Unlike execution_sla (which only checks if the dbt model ran on time), data_freshness_sla checks whether the actual data is fresh. A pipeline can run successfully but still serve stale data if, for example, an upstream source didn’t update. This test catches that.
The timestamp_column values are assumed to be in UTC (or timezone-naive timestamps that represent UTC). If your data stores local timestamps, the comparison may be incorrect.
If both day_of_week and day_of_month are set, the test uses OR logic (checks if either matches)
The test passes if the SLA deadline hasn’t been reached yet, giving your data time to be updated