Skip to content

Commit 4d46b20

Browse files
Updating freshness ref page (#4770)
## What are you changing in this pull request and why? Updating the `freshness` ref page to include new information for v1.7 Closes #4615 ## Checklist - [x] Review the [Content style guide](https://github.com/dbt-labs/docs.getdbt.com/blob/current/contributing/content-style-guide.md) so my content adheres to these guidelines. - [x] For [docs versioning](https://github.com/dbt-labs/docs.getdbt.com/blob/current/contributing/single-sourcing-content.md#about-versioning), review how to [version a whole page](https://github.com/dbt-labs/docs.getdbt.com/blob/current/contributing/single-sourcing-content.md#adding-a-new-version) and [version a block of content](https://github.com/dbt-labs/docs.getdbt.com/blob/current/contributing/single-sourcing-content.md#versioning-blocks-of-content). - [x] Add a checklist item for anything that needs to happen before this PR is merged, such as "needs technical review" or "change base branch."
2 parents dc9ac9a + 6a8ee06 commit 4d46b20

File tree

1 file changed

+33
-1
lines changed

1 file changed

+33
-1
lines changed

website/docs/reference/resource-properties/freshness.md

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,38 @@ A freshness block is used to define the acceptable amount of time between the mo
3737

3838
In the `freshness` block, one or both of `warn_after` and `error_after` can be provided. If neither is provided, then dbt will not calculate freshness snapshots for the tables in this source.
3939

40+
<VersionBlock firstVersion="1.7">
41+
42+
In most cases, the `loaded_at_field` is required. Some adapters support calculating source freshness from the warehouse metadata tables and can exclude the `loaded_at_field`.
43+
44+
If a source has a `freshness:` block, dbt will attempt to calculate freshness for that source:
45+
- If a `loaded_at_field` is provided, dbt will calculate freshness via a select query (behavior prior to v1.7).
46+
- If a `loaded_at_field` is _not_ provided, dbt will calculate freshness via warehouse metadata tables when possible (new in v1.7 on supported adapters).
47+
48+
Currently, calculating freshness from warehouse metadata tables is supported on:
49+
- [Snowflake](/reference/resource-configs/snowflake-configs)
50+
51+
Support is coming soon to the following adapters:
52+
- [Redshift](/reference/resource-configs/redshift-configs)
53+
- [BigQuery](/reference/resource-configs/bigquery-configs)
54+
- [Spark](/reference/resource-configs/spark-configs)
55+
56+
Freshness blocks are applied hierarchically:
57+
- a `freshness` and `loaded_at_field` property added to a source will be applied to all all tables defined in that source
58+
- a `freshness` and `loaded_at_field` property added to a source _table_ will override any properties applied to the source.
59+
60+
This is useful when all of the tables in a source have the same `loaded_at_field`, as is often the case.
61+
62+
To exclude a source from freshness calculations, you have two options:
63+
- Don't add a `freshness:` block.
64+
- Explicitly set `freshness: null`.
65+
66+
## loaded_at_field
67+
(Optional on adapters that support pulling freshness from warehouse metadata tables, required otherwise.)
68+
</VersionBlock>
69+
70+
<VersionBlock lastVersion="1.6">
71+
4072
Additionally, the `loaded_at_field` is required to calculate freshness for a table. If a `loaded_at_field` is not provided, then dbt will not calculate freshness for the table.
4173

4274
Freshness blocks are applied hierarchically:
@@ -47,7 +79,7 @@ This is useful when all of the tables in a source have the same `loaded_at_field
4779

4880
## loaded_at_field
4981
(Required)
50-
82+
</VersionBlock>
5183
A column name (or expression) that returns a timestamp indicating freshness.
5284

5385
If using a date field, you may have to cast it to a timestamp:

0 commit comments

Comments
 (0)