You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Source freshness results from dbt v2 store a null max_loaded_at_time_ago_in_s (process_freshness_result reads age) #1098
With dbt v2, every row that upload_source_freshness writes to dbt_source_freshness_results has max_loaded_at_time_ago_in_s = NULL. max_loaded_at and snapshotted_at are filled in as usual.
process_freshness_result reads the value from result_dict.age (L44). dbt-core's freshness result has age, but the result dbt v2 passes to the on-run-end hook does not. It has the value under max_loaded_at_time_ago_in_s, the name dbt uses in sources.json. Logging result.to_dict() in an on-run-end hook with dbt v2 2.0.11 shows these keys:
with, for example, max_loaded_at_time_ago_in_s = 49349.0, while result.age is undefined.
The null hides the freshness details in the Elementary report, and freshness alerts show "Time Elapsed: N/A".
To Reproduce
In a project with the Elementary package, configure freshness on a source.
Run dbt source freshness with dbt v2.
In dbt_source_freshness_results, the new row has max_loaded_at_time_ago_in_s = NULL.
On BigQuery, over 7 days of our scheduled dbt v2 runs, all 1046 rows had a null max_loaded_at_time_ago_in_s, and none had a null max_loaded_at or snapshotted_at.
Expected behavior
max_loaded_at_time_ago_in_s is stored whichever engine ran the freshness check.
That issue also mentioned that process_freshness_result compares status == "runtime error" case-sensitively. With dbt v2 2.0.11 this doesn't come up: when a source's freshness check errors, dbt v2 leaves the source out of results (and out of sources.json), so the hook never sees it.
Would you be willing to contribute a fix for this issue?
changed the title [-]Source freshness results from dbt Fusion store a null `max_loaded_at_time_ago_in_s` (`process_freshness_result` reads `age`)[/-][+]Source freshness results from dbt v2 store a null `max_loaded_at_time_ago_in_s` (`process_freshness_result` reads `age`)[/+]on Nov 10, 2026
Activity
[-]Source freshness results from dbt Fusion store a null `max_loaded_at_time_ago_in_s` (`process_freshness_result` reads `age`)[/-][+]Source freshness results from dbt v2 store a null `max_loaded_at_time_ago_in_s` (`process_freshness_result` reads `age`)[/+]