{"id":830,"date":"2026-01-30T12:19:34","date_gmt":"2026-01-30T12:19:34","guid":{"rendered":"https:\/\/datadandies.nl\/?p=830"},"modified":"2026-01-30T12:19:34","modified_gmt":"2026-01-30T12:19:34","slug":"checking-for-data-freshness-of-your-tables-using-data-build-tool-dbt","status":"publish","type":"post","link":"https:\/\/datadandies.nl\/index.php\/2026\/01\/30\/checking-for-data-freshness-of-your-tables-using-data-build-tool-dbt\/","title":{"rendered":"Checking for data freshness of your tables using Data Build Tool (dbt)"},"content":{"rendered":"\n<p>Would you like to check if a table contains stale data? Nothing more embarrassing than having a user of a report point out that your data is wrinkled and saggy!<\/p>\n\n\n\n<p>As responsible Data Engineers \/ Analytics Engineers \/ Insert New Buzzword Job Title Here&#8230; we would like to be one step ahead of the users that consume our products (dashboards, tables, reports, etc.)<\/p>\n\n\n\n<p>There is an easy solution in Data Build Tool (dbt). You can define \u201cfreshness\u201d for a table in sources.yml.<\/p>\n\n\n\n<p>It looks like this:<\/p>\n\n\n\n<p>sources:<\/p>\n\n\n\n<p>&nbsp; &#8211; name: cool_source<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp; database: some_database<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp; schema: some_schema<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp; tables:<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp; &#8211; name: orders<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; config:<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; freshness: # I want to monitor how fresh my orders data is. Command \u201cdbt source freshness\u201d in terminal<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; warn_after: # I want to get a warning when the newest record in my dataset is older than 24 hours<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; count: 24<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; period: hour<\/p>\n\n\n\n<p>So next time a user of an object that you created points out that your data is past its expiry date, your response can be twofold:<\/p>\n\n\n\n<p>1. First of all, how dare you.<\/p>\n\n\n\n<p>2. Secondly, let me add freshness to my sources.yml and toggle notifications on in my Gitlab pipeline that runs the daily refresh so I get an email notifying me whenever my data is stale. Th\u00e1t will teach them!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Would you like to check if a table contains stale data? Nothing more embarrassing than having a user of a report point out that your data is wrinkled and saggy! As responsible Data Engineers \/ Analytics Engineers \/ Insert New Buzzword Job Title Here&#8230; we would like to be one step ahead of the users&hellip;<\/p>\n<p class=\"more-link\"><a href=\"https:\/\/datadandies.nl\/index.php\/2026\/01\/30\/checking-for-data-freshness-of-your-tables-using-data-build-tool-dbt\/\" class=\"themebutton\">Read More<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[69],"class_list":["post-830","post","type-post","status-publish","format-standard","hentry","category-blog","tag-dbt"],"_links":{"self":[{"href":"https:\/\/datadandies.nl\/index.php\/wp-json\/wp\/v2\/posts\/830","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/datadandies.nl\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/datadandies.nl\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/datadandies.nl\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/datadandies.nl\/index.php\/wp-json\/wp\/v2\/comments?post=830"}],"version-history":[{"count":1,"href":"https:\/\/datadandies.nl\/index.php\/wp-json\/wp\/v2\/posts\/830\/revisions"}],"predecessor-version":[{"id":831,"href":"https:\/\/datadandies.nl\/index.php\/wp-json\/wp\/v2\/posts\/830\/revisions\/831"}],"wp:attachment":[{"href":"https:\/\/datadandies.nl\/index.php\/wp-json\/wp\/v2\/media?parent=830"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/datadandies.nl\/index.php\/wp-json\/wp\/v2\/categories?post=830"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/datadandies.nl\/index.php\/wp-json\/wp\/v2\/tags?post=830"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}