I'd like to use `dbt-utils.recency` as the test fo...
# ask-elementary-ai
g
I'd like to use
dbt-utils.recency
as the test for freshness. I have these 2 questions: • can freshness be measured for models? I know it can be calculated for sources • Looks like Elementary is configured to gather freshness data from event_freshness_anomalies, freshness_anomalies, tabl_anomalies or source_freshness, but no recency. However, in dbt tests hub, recency is classified as a freshness test Could you clarify both points?
k
Great questions! Here's a clarification on both points: 1. Can
dbt_utils.recency
be used on models (not just sources)?
Yes.
dbt_utils.recency
can be applied to both sources and models. It is a standard dbt test and is not restricted to sources only. [community Q&A; best practices] For comparison, dbt's native
source freshness
is only for sources, while Elementary's own
freshness_anomalies
works on both sources and models. [works on models and sources] 2. How does Elementary handle
dbt_utils.recency
results?
dbt_utils.recency
is not natively recognized as a "freshness" category in Elementary's dashboard — it won't appear as a dedicated freshness card. However, since it is a standard dbt test, it will appear in the Elementary report like any other dbt test. [community Q&A] So while Elementary collects and displays its results, it won't be grouped or labeled as a freshness test specifically within the Elementary UI. Summary | Test | Works on models? | Works on sources? | Shown in Elementary as freshness? | | - | - | - | - | |
dbt source freshness
| ❌ | ✅ | ❌ (alerts only, not in report) | |
elementary.freshness_anomalies
| ✅ | ✅ | ✅ | |
dbt_utils.recency
| ✅ | ✅ | ❌ (shown as a generic test) | If you want freshness results to be properly surfaced as freshness in Elementary,
elementary.freshness_anomalies
is the recommended approach. If you prefer a fixed threshold (e.g., "fail if data is older than X hours"),
dbt_utils.recency
is a valid alternative — just know it will appear as a generic test in Elementary's report. [best practices] 👍 0 button 👎 0 button ℹ️ Tip: Mention @elementary.ai in the thread for follow-ups or DM the app for 1-to-1 help.