<script data-pm-proxy="intercept"></script><?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" xmlns:googleplay="http://www.google.com/schemas/play-podcasts/1.0"><channel><title><![CDATA[Andrea Leonel - Data Analysis & Analytics Engineering]]></title><description><![CDATA[Mastering dbt, analytics engineering and data analysis]]></description><link>https://andrealeonel.substack.com</link><image><url>https://substackcdn.com/image/fetch/$s_!TwlV!,w_256,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0b5ecf6f-7ab0-4ae3-a73f-95478b9fef4e_500x500.png</url><title>Andrea Leonel - Data Analysis &amp; Analytics Engineering</title><link>https://andrealeonel.substack.com</link></image><generator>Substack</generator><lastBuildDate>Fri, 04 Sep 2026 21:41:46 GMT</lastBuildDate><atom:link href="/__u/andrealeonel.substack.com/feed" rel="self" type="application/rss+xml"/><copyright><![CDATA[Andrea Leonel]]></copyright><language><![CDATA[en]]></language><webMaster><![CDATA[andrealeonel@substack.com]]></webMaster><itunes:owner><itunes:email><![CDATA[andrealeonel@substack.com]]></itunes:email><itunes:name><![CDATA[Andrea Leonel]]></itunes:name></itunes:owner><itunes:author><![CDATA[Andrea Leonel]]></itunes:author><googleplay:owner><![CDATA[andrealeonel@substack.com]]></googleplay:owner><googleplay:email><![CDATA[andrealeonel@substack.com]]></googleplay:email><googleplay:author><![CDATA[Andrea Leonel]]></googleplay:author><itunes:block><![CDATA[Yes]]></itunes:block><item><title><![CDATA[Options for custom generic testing]]></title><description><![CDATA[Take advantage of custom generic testing to build even more flexible assertions]]></description><link>https://andrealeonel.substack.com/p/options-for-custom-generic-testing</link><guid isPermaLink="false">https://andrealeonel.substack.com/p/options-for-custom-generic-testing</guid><pubDate>Fri, 28 Aug 2026 22:25:05 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!Zxdl!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F53981c7e-ef23-4bcc-8433-25661ca66111_978x368.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p><em>Part of the <a href="/__u/andrealeonel.substack.com/p/study-for-the-dbt-analytics-engineering">Mastering dbt</a> series. Access to the full <a href="/__u/andrealeonel.substack.com/p/dbt-analytics-engineering-certification">Study Guide</a>. Let&#8217;s connect on <a href="https://www.linkedin.com/in/andrealeonel/">LinkedIn</a>!<br>Notes from the <a href="https://docs.getdbt.com/reference/global-configs/behavior-changes?version=1.11">About behaviour change</a> documentation.</em></p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://andrealeonel.substack.com/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption">Join hundreds of aspiring dbt developers &amp; data analysts!</p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div><p>We have several <a href="/__u/andrealeonel.substack.com/i/169603250/3-operating-dbt-in-production">test-related study notes</a> already published. But let&#8217;s recap:</p><p>Data tests are assumptions we make about resources in our project. For instance, we can configure a model to fail or issue a warning when certain preset requirements are not met.</p><p>They can broadly be divided into <a href="/__u/andrealeonel.substack.com/p/adding-data-tests-to-your-dag?open=false#%C2%A7adding-tests-to-your-dag">singular tests and generic tests</a>. Generic tests can either be provided by dbt or defined/customised by users.</p><p>This post is dedicated specifically to custom generic tests, although we will touch on standard generic tests for differentiation purposes.</p><div><hr></div><h3>What are custom generic tests?</h3><p>Before we go deep into custom generic tests, let&#8217;s zoom out for a second.</p><p>Within the realm of generic tests, we have:</p><p>Built-in generic tests: </p><ul><li><p>NotNull</p></li><li><p>Unique</p></li><li><p>Relationship</p></li><li><p>Accepted Values</p></li></ul><p>Custom generic tests:</p><ul><li><p> with standard arguments: tests that use the two standard arguments of <em>model </em>and <em>column_name.</em></p></li><li><p>with additional arguments: tests that, besides the two standard arguments, also use bespoke arguments in their assertions.</p></li><li><p>optionally overriding a built-in generic test: the ability to modify the built-in tests above by adding them to a test block</p></li></ul><p>Apologies if this is obvious for you, I find the naming convention dbt uses for tests quite confusing so I felt the need to redefine them here.</p><p>Generic tests can be stored in <em>tests/generic/ </em>or <em>macros/</em>. The latter can be convenient when the test depends on complex macro logic that you want to keep in the same file.</p><p>When documenting a custom generic test in a <em>schema.yml</em> file, use the <em>test_</em> prefix when specifying the macro's name. For example, a test block named <em>not_empty_string </em> is documented as <em>test_not_empty_string</em>.</p><h3>Recap on custom generic tests with standard arguments:</h3><p>All custom generic tests are required to go inside a test block with the arguments below:</p><ul><li><p>model (required): the resource on which the test is defined. The argument is always named model, even when the resource is a source, seed, or snapshot.</p></li><li><p>column_name: the column on which the test is defined - for those tests that do operate on the column level.</p></li></ul><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="/__u/substackcdn.com/image/fetch/$s_!A2My!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa356e051-ae17-435a-9c78-8ac8e8309096_1005x911.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="/__u/substackcdn.com/image/fetch/$s_!A2My!, /__u/andrealeonel.substack.com/w_424, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa356e051-ae17-435a-9c78-8ac8e8309096_1005x911.png 424w, /__u/substackcdn.com/image/fetch/$s_!A2My!, /__u/andrealeonel.substack.com/w_848, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa356e051-ae17-435a-9c78-8ac8e8309096_1005x911.png 848w, /__u/substackcdn.com/image/fetch/$s_!A2My!, /__u/andrealeonel.substack.com/w_1272, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa356e051-ae17-435a-9c78-8ac8e8309096_1005x911.png 1272w, /__u/substackcdn.com/image/fetch/$s_!A2My!, /__u/andrealeonel.substack.com/w_1456, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa356e051-ae17-435a-9c78-8ac8e8309096_1005x911.png 1456w" sizes="100vw"><img src="/__u/substackcdn.com/image/fetch/$s_!A2My!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa356e051-ae17-435a-9c78-8ac8e8309096_1005x911.png" width="1005" height="911" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/a356e051-ae17-435a-9c78-8ac8e8309096_1005x911.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:911,&quot;width&quot;:1005,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:64884,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://andrealeonel.substack.com/i/213202650?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa356e051-ae17-435a-9c78-8ac8e8309096_1005x911.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="/__u/substackcdn.com/image/fetch/$s_!A2My!, /__u/andrealeonel.substack.com/w_424, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa356e051-ae17-435a-9c78-8ac8e8309096_1005x911.png 424w, /__u/substackcdn.com/image/fetch/$s_!A2My!, /__u/andrealeonel.substack.com/w_848, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa356e051-ae17-435a-9c78-8ac8e8309096_1005x911.png 848w, /__u/substackcdn.com/image/fetch/$s_!A2My!, /__u/andrealeonel.substack.com/w_1272, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa356e051-ae17-435a-9c78-8ac8e8309096_1005x911.png 1272w, /__u/substackcdn.com/image/fetch/$s_!A2My!, /__u/andrealeonel.substack.com/w_1456, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa356e051-ae17-435a-9c78-8ac8e8309096_1005x911.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption">Example test using both arguments. Source: <a href="https://docs.getdbt.com/best-practices/writing-custom-generic-tests?version=1.11#generic-tests-with-standard-arguments">dbt</a></figcaption></figure></div><p>The final select should return records which fail the test. A generic data test passes when its query returns zero rows. Any rows returned represent records that violate the test condition and therefore cause the test to fail.</p><p>Also, the test can be reused for any model and column as long as it&#8217;s declared in the yaml file for the desired resources. Below, it&#8217;s being declared for the <em>favorite_number </em>column in the <em>users</em> model. But you could also declare it for other columns in the same or other resources.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="/__u/substackcdn.com/image/fetch/$s_!TutD!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Febd9f5b0-ec24-4a11-be05-b78a402a7efb_994x325.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="/__u/substackcdn.com/image/fetch/$s_!TutD!, /__u/andrealeonel.substack.com/w_424, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Febd9f5b0-ec24-4a11-be05-b78a402a7efb_994x325.png 424w, /__u/substackcdn.com/image/fetch/$s_!TutD!, /__u/andrealeonel.substack.com/w_848, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Febd9f5b0-ec24-4a11-be05-b78a402a7efb_994x325.png 848w, /__u/substackcdn.com/image/fetch/$s_!TutD!, /__u/andrealeonel.substack.com/w_1272, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Febd9f5b0-ec24-4a11-be05-b78a402a7efb_994x325.png 1272w, /__u/substackcdn.com/image/fetch/$s_!TutD!, /__u/andrealeonel.substack.com/w_1456, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Febd9f5b0-ec24-4a11-be05-b78a402a7efb_994x325.png 1456w" sizes="100vw"><img src="/__u/substackcdn.com/image/fetch/$s_!TutD!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Febd9f5b0-ec24-4a11-be05-b78a402a7efb_994x325.png" width="994" height="325" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/ebd9f5b0-ec24-4a11-be05-b78a402a7efb_994x325.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:325,&quot;width&quot;:994,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:24230,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://andrealeonel.substack.com/i/213202650?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Febd9f5b0-ec24-4a11-be05-b78a402a7efb_994x325.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="/__u/substackcdn.com/image/fetch/$s_!TutD!, /__u/andrealeonel.substack.com/w_424, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Febd9f5b0-ec24-4a11-be05-b78a402a7efb_994x325.png 424w, /__u/substackcdn.com/image/fetch/$s_!TutD!, /__u/andrealeonel.substack.com/w_848, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Febd9f5b0-ec24-4a11-be05-b78a402a7efb_994x325.png 848w, /__u/substackcdn.com/image/fetch/$s_!TutD!, /__u/andrealeonel.substack.com/w_1272, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Febd9f5b0-ec24-4a11-be05-b78a402a7efb_994x325.png 1272w, /__u/substackcdn.com/image/fetch/$s_!TutD!, /__u/andrealeonel.substack.com/w_1456, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Febd9f5b0-ec24-4a11-be05-b78a402a7efb_994x325.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption">Test being declared in the model.yml file with a description property. Source: <a href="https://docs.getdbt.com/best-practices/writing-custom-generic-tests?version=1.11#generic-tests-with-standard-arguments">dbt</a></figcaption></figure></div><p>Finally, in the example above, the test operates on a column and therefore is declared under the <em>column: </em>block. However, a test may operate on an entire model, in which case, it can be declared directly under the <em>model: </em>block.</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="/__u/substackcdn.com/image/fetch/$s_!Vh2O!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F65eaae1c-dd2a-476f-8464-174bf8967f58_711x127.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="/__u/substackcdn.com/image/fetch/$s_!Vh2O!, /__u/andrealeonel.substack.com/w_424, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F65eaae1c-dd2a-476f-8464-174bf8967f58_711x127.png 424w, /__u/substackcdn.com/image/fetch/$s_!Vh2O!, /__u/andrealeonel.substack.com/w_848, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F65eaae1c-dd2a-476f-8464-174bf8967f58_711x127.png 848w, /__u/substackcdn.com/image/fetch/$s_!Vh2O!, /__u/andrealeonel.substack.com/w_1272, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F65eaae1c-dd2a-476f-8464-174bf8967f58_711x127.png 1272w, /__u/substackcdn.com/image/fetch/$s_!Vh2O!, /__u/andrealeonel.substack.com/w_1456, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F65eaae1c-dd2a-476f-8464-174bf8967f58_711x127.png 1456w" sizes="100vw"><img src="/__u/substackcdn.com/image/fetch/$s_!Vh2O!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F65eaae1c-dd2a-476f-8464-174bf8967f58_711x127.png" width="711" height="127" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/65eaae1c-dd2a-476f-8464-174bf8967f58_711x127.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:127,&quot;width&quot;:711,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:3801,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://andrealeonel.substack.com/i/213202650?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F65eaae1c-dd2a-476f-8464-174bf8967f58_711x127.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="/__u/substackcdn.com/image/fetch/$s_!Vh2O!, /__u/andrealeonel.substack.com/w_424, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F65eaae1c-dd2a-476f-8464-174bf8967f58_711x127.png 424w, /__u/substackcdn.com/image/fetch/$s_!Vh2O!, /__u/andrealeonel.substack.com/w_848, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F65eaae1c-dd2a-476f-8464-174bf8967f58_711x127.png 848w, /__u/substackcdn.com/image/fetch/$s_!Vh2O!, /__u/andrealeonel.substack.com/w_1272, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F65eaae1c-dd2a-476f-8464-174bf8967f58_711x127.png 1272w, /__u/substackcdn.com/image/fetch/$s_!Vh2O!, /__u/andrealeonel.substack.com/w_1456, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F65eaae1c-dd2a-476f-8464-174bf8967f58_711x127.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a><figcaption class="image-caption">A test being declares at the model level. Source: ChatGPT</figcaption></figure></div><h3>Custom generic tests with additional arguments</h3><p>Besides the standard arguments, you can also add bespoke arguments relevant to your test. For example, the test below is testing models for a minimum number of rows.</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="/__u/substackcdn.com/image/fetch/$s_!EJrz!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4062f7d5-17a5-4454-9c30-1ed1dfb37f27_688x181.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="/__u/substackcdn.com/image/fetch/$s_!EJrz!, /__u/andrealeonel.substack.com/w_424, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4062f7d5-17a5-4454-9c30-1ed1dfb37f27_688x181.png 424w, /__u/substackcdn.com/image/fetch/$s_!EJrz!, /__u/andrealeonel.substack.com/w_848, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4062f7d5-17a5-4454-9c30-1ed1dfb37f27_688x181.png 848w, /__u/substackcdn.com/image/fetch/$s_!EJrz!, /__u/andrealeonel.substack.com/w_1272, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4062f7d5-17a5-4454-9c30-1ed1dfb37f27_688x181.png 1272w, /__u/substackcdn.com/image/fetch/$s_!EJrz!, /__u/andrealeonel.substack.com/w_1456, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4062f7d5-17a5-4454-9c30-1ed1dfb37f27_688x181.png 1456w" sizes="100vw"><img src="/__u/substackcdn.com/image/fetch/$s_!EJrz!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4062f7d5-17a5-4454-9c30-1ed1dfb37f27_688x181.png" width="688" height="181" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/4062f7d5-17a5-4454-9c30-1ed1dfb37f27_688x181.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:181,&quot;width&quot;:688,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:7836,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://andrealeonel.substack.com/i/213202650?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4062f7d5-17a5-4454-9c30-1ed1dfb37f27_688x181.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="/__u/substackcdn.com/image/fetch/$s_!EJrz!, /__u/andrealeonel.substack.com/w_424, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4062f7d5-17a5-4454-9c30-1ed1dfb37f27_688x181.png 424w, /__u/substackcdn.com/image/fetch/$s_!EJrz!, /__u/andrealeonel.substack.com/w_848, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4062f7d5-17a5-4454-9c30-1ed1dfb37f27_688x181.png 848w, /__u/substackcdn.com/image/fetch/$s_!EJrz!, /__u/andrealeonel.substack.com/w_1272, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4062f7d5-17a5-4454-9c30-1ed1dfb37f27_688x181.png 1272w, /__u/substackcdn.com/image/fetch/$s_!EJrz!, /__u/andrealeonel.substack.com/w_1456, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4062f7d5-17a5-4454-9c30-1ed1dfb37f27_688x181.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a><figcaption class="image-caption">Example test with additional arguments. Source: ChatGPT</figcaption></figure></div><p>The additional argument is declared in the model.yml file where you can set the default value to be used by the test:</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="/__u/substackcdn.com/image/fetch/$s_!52JW!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F84e97043-1e70-457d-819b-221aa8112da0_694x158.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="/__u/substackcdn.com/image/fetch/$s_!52JW!, /__u/andrealeonel.substack.com/w_424, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F84e97043-1e70-457d-819b-221aa8112da0_694x158.png 424w, /__u/substackcdn.com/image/fetch/$s_!52JW!, /__u/andrealeonel.substack.com/w_848, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F84e97043-1e70-457d-819b-221aa8112da0_694x158.png 848w, /__u/substackcdn.com/image/fetch/$s_!52JW!, /__u/andrealeonel.substack.com/w_1272, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F84e97043-1e70-457d-819b-221aa8112da0_694x158.png 1272w, /__u/substackcdn.com/image/fetch/$s_!52JW!, /__u/andrealeonel.substack.com/w_1456, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F84e97043-1e70-457d-819b-221aa8112da0_694x158.png 1456w" sizes="100vw"><img src="/__u/substackcdn.com/image/fetch/$s_!52JW!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F84e97043-1e70-457d-819b-221aa8112da0_694x158.png" width="694" height="158" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/84e97043-1e70-457d-819b-221aa8112da0_694x158.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:158,&quot;width&quot;:694,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:5429,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://andrealeonel.substack.com/i/213202650?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F84e97043-1e70-457d-819b-221aa8112da0_694x158.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="/__u/substackcdn.com/image/fetch/$s_!52JW!, /__u/andrealeonel.substack.com/w_424, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F84e97043-1e70-457d-819b-221aa8112da0_694x158.png 424w, /__u/substackcdn.com/image/fetch/$s_!52JW!, /__u/andrealeonel.substack.com/w_848, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F84e97043-1e70-457d-819b-221aa8112da0_694x158.png 848w, /__u/substackcdn.com/image/fetch/$s_!52JW!, /__u/andrealeonel.substack.com/w_1272, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F84e97043-1e70-457d-819b-221aa8112da0_694x158.png 1272w, /__u/substackcdn.com/image/fetch/$s_!52JW!, /__u/andrealeonel.substack.com/w_1456, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F84e97043-1e70-457d-819b-221aa8112da0_694x158.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a><figcaption class="image-caption">Declaring the min_rows argument used in the minimum_row_count test. Source: ChatGPT</figcaption></figure></div><h3>Customising built-in generic tests</h3><p>Finally, another option you have with tests is to modify the out-of-the-box tests.</p><p>You can do that by simply adding a test block using the name of one of the built-in tests. dbt will favour your version over the default one.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="/__u/substackcdn.com/image/fetch/$s_!3zb6!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6d0fc8a5-16bc-473c-a1fa-3682c9c97253_988x254.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="/__u/substackcdn.com/image/fetch/$s_!3zb6!, /__u/andrealeonel.substack.com/w_424, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6d0fc8a5-16bc-473c-a1fa-3682c9c97253_988x254.png 424w, /__u/substackcdn.com/image/fetch/$s_!3zb6!, /__u/andrealeonel.substack.com/w_848, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6d0fc8a5-16bc-473c-a1fa-3682c9c97253_988x254.png 848w, /__u/substackcdn.com/image/fetch/$s_!3zb6!, /__u/andrealeonel.substack.com/w_1272, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6d0fc8a5-16bc-473c-a1fa-3682c9c97253_988x254.png 1272w, /__u/substackcdn.com/image/fetch/$s_!3zb6!, /__u/andrealeonel.substack.com/w_1456, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6d0fc8a5-16bc-473c-a1fa-3682c9c97253_988x254.png 1456w" sizes="100vw"><img src="/__u/substackcdn.com/image/fetch/$s_!3zb6!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6d0fc8a5-16bc-473c-a1fa-3682c9c97253_988x254.png" width="988" height="254" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/6d0fc8a5-16bc-473c-a1fa-3682c9c97253_988x254.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:254,&quot;width&quot;:988,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:21992,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://andrealeonel.substack.com/i/213202650?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6d0fc8a5-16bc-473c-a1fa-3682c9c97253_988x254.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="/__u/substackcdn.com/image/fetch/$s_!3zb6!, /__u/andrealeonel.substack.com/w_424, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6d0fc8a5-16bc-473c-a1fa-3682c9c97253_988x254.png 424w, /__u/substackcdn.com/image/fetch/$s_!3zb6!, /__u/andrealeonel.substack.com/w_848, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6d0fc8a5-16bc-473c-a1fa-3682c9c97253_988x254.png 848w, /__u/substackcdn.com/image/fetch/$s_!3zb6!, /__u/andrealeonel.substack.com/w_1272, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6d0fc8a5-16bc-473c-a1fa-3682c9c97253_988x254.png 1272w, /__u/substackcdn.com/image/fetch/$s_!3zb6!, /__u/andrealeonel.substack.com/w_1456, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6d0fc8a5-16bc-473c-a1fa-3682c9c97253_988x254.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption">Modifying the default unique test to whatever sql you&#8217;d like. Source: <a href="https://docs.getdbt.com/best-practices/writing-custom-generic-tests?version=1.11#customizing-dbts-built-in-tests">dbt</a></figcaption></figure></div><h3>Using the config( ) block inside a custom generic test </h3><p>You can add <em>config( )</em> blocks to a custom generic test definition. Values defined there will be applied for all instances of that generic test. For instance, below we&#8217;re configuring the <em>warn_if_odd </em>test to serve a warning in case it fails.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="/__u/substackcdn.com/image/fetch/$s_!Zxdl!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F53981c7e-ef23-4bcc-8433-25661ca66111_978x368.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="/__u/substackcdn.com/image/fetch/$s_!Zxdl!, /__u/andrealeonel.substack.com/w_424, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F53981c7e-ef23-4bcc-8433-25661ca66111_978x368.png 424w, /__u/substackcdn.com/image/fetch/$s_!Zxdl!, /__u/andrealeonel.substack.com/w_848, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F53981c7e-ef23-4bcc-8433-25661ca66111_978x368.png 848w, /__u/substackcdn.com/image/fetch/$s_!Zxdl!, /__u/andrealeonel.substack.com/w_1272, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F53981c7e-ef23-4bcc-8433-25661ca66111_978x368.png 1272w, /__u/substackcdn.com/image/fetch/$s_!Zxdl!, /__u/andrealeonel.substack.com/w_1456, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F53981c7e-ef23-4bcc-8433-25661ca66111_978x368.png 1456w" sizes="100vw"><img src="/__u/substackcdn.com/image/fetch/$s_!Zxdl!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F53981c7e-ef23-4bcc-8433-25661ca66111_978x368.png" width="978" height="368" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/53981c7e-ef23-4bcc-8433-25661ca66111_978x368.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:368,&quot;width&quot;:978,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:34583,&quot;alt&quot;:&quot;&quot;,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://andrealeonel.substack.com/i/213202650?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F53981c7e-ef23-4bcc-8433-25661ca66111_978x368.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" title="" srcset="/__u/substackcdn.com/image/fetch/$s_!Zxdl!, /__u/andrealeonel.substack.com/w_424, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F53981c7e-ef23-4bcc-8433-25661ca66111_978x368.png 424w, /__u/substackcdn.com/image/fetch/$s_!Zxdl!, /__u/andrealeonel.substack.com/w_848, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F53981c7e-ef23-4bcc-8433-25661ca66111_978x368.png 848w, /__u/substackcdn.com/image/fetch/$s_!Zxdl!, /__u/andrealeonel.substack.com/w_1272, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F53981c7e-ef23-4bcc-8433-25661ca66111_978x368.png 1272w, /__u/substackcdn.com/image/fetch/$s_!Zxdl!, /__u/andrealeonel.substack.com/w_1456, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F53981c7e-ef23-4bcc-8433-25661ca66111_978x368.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption">If any values in column_name are odd, dbt will issue a warning rather than treating the test failure as an error. Source: <a href="https://docs.getdbt.com/best-practices/writing-custom-generic-tests?version=1.11#generic-tests-with-default-config-values">dbt</a></figcaption></figure></div><p>You can, however, override that config for specific columns or models. Like below where we are telling dbt to throw an error instead when the <em>warn_if_odd </em>test is applied specifically against the <em>other_number </em>column of the <em>users </em>model.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="/__u/substackcdn.com/image/fetch/$s_!Dkdu!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd4749cd6-bc8c-4bc7-964e-6b7efa452436_980x523.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="/__u/substackcdn.com/image/fetch/$s_!Dkdu!, /__u/andrealeonel.substack.com/w_424, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd4749cd6-bc8c-4bc7-964e-6b7efa452436_980x523.png 424w, /__u/substackcdn.com/image/fetch/$s_!Dkdu!, /__u/andrealeonel.substack.com/w_848, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd4749cd6-bc8c-4bc7-964e-6b7efa452436_980x523.png 848w, /__u/substackcdn.com/image/fetch/$s_!Dkdu!, /__u/andrealeonel.substack.com/w_1272, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd4749cd6-bc8c-4bc7-964e-6b7efa452436_980x523.png 1272w, /__u/substackcdn.com/image/fetch/$s_!Dkdu!, /__u/andrealeonel.substack.com/w_1456, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd4749cd6-bc8c-4bc7-964e-6b7efa452436_980x523.png 1456w" sizes="100vw"><img src="/__u/substackcdn.com/image/fetch/$s_!Dkdu!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd4749cd6-bc8c-4bc7-964e-6b7efa452436_980x523.png" width="980" height="523" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/d4749cd6-bc8c-4bc7-964e-6b7efa452436_980x523.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:523,&quot;width&quot;:980,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:69976,&quot;alt&quot;:&quot;&quot;,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://andrealeonel.substack.com/i/213202650?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd4749cd6-bc8c-4bc7-964e-6b7efa452436_980x523.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" title="" srcset="/__u/substackcdn.com/image/fetch/$s_!Dkdu!, /__u/andrealeonel.substack.com/w_424, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd4749cd6-bc8c-4bc7-964e-6b7efa452436_980x523.png 424w, /__u/substackcdn.com/image/fetch/$s_!Dkdu!, /__u/andrealeonel.substack.com/w_848, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd4749cd6-bc8c-4bc7-964e-6b7efa452436_980x523.png 848w, /__u/substackcdn.com/image/fetch/$s_!Dkdu!, /__u/andrealeonel.substack.com/w_1272, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd4749cd6-bc8c-4bc7-964e-6b7efa452436_980x523.png 1272w, /__u/substackcdn.com/image/fetch/$s_!Dkdu!, /__u/andrealeonel.substack.com/w_1456, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd4749cd6-bc8c-4bc7-964e-6b7efa452436_980x523.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption">Overriding the config( ) block set in the test definition for a specific column. Source: <a href="https://docs.getdbt.com/best-practices/writing-custom-generic-tests?version=1.11#generic-tests-with-default-config-values">dbt</a></figcaption></figure></div>]]></content:encoded></item><item><title><![CDATA[Behaviour change flags and why they’re so important]]></title><description><![CDATA[Using flags to opt in or out of new dbt behaviour]]></description><link>https://andrealeonel.substack.com/p/behaviour-change-flags-and-why-theyre</link><guid isPermaLink="false">https://andrealeonel.substack.com/p/behaviour-change-flags-and-why-theyre</guid><pubDate>Sat, 22 Aug 2026 01:12:51 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!wpV4!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3941b7be-9f1b-484c-a0ba-ace8a270aaec_996x550.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p><em>Part of the <a href="/__u/andrealeonel.substack.com/p/study-for-the-dbt-analytics-engineering">Mastering dbt</a> series. Access to the full <a href="/__u/andrealeonel.substack.com/p/dbt-analytics-engineering-certification">Study Guide</a>. Let&#8217;s connect on <a href="https://www.linkedin.com/in/andrealeonel/">LinkedIn</a>!<br>Notes from the <a href="https://docs.getdbt.com/reference/global-configs/behavior-changes?version=1.11">About behaviour change</a> documentation.</em></p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://andrealeonel.substack.com/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption">Join hundreds of aspiring dbt developers &amp; data analysts!</p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div><p>Sometimes, dbt changes existing behaviour to improve correctness, consistency, usability, or performance.</p><p>For instance, in v1.11, dbt introduced changes around how duplicate resource names are handled and how dbt determines whether resources are modified during state-aware execution.</p><p>These changes affect how your code is parsed, selected, or executed. If a behaviour change were implemented without a transition mechanism, projects that previously worked could behave differently or fail after a dbt upgrade.</p><p>That&#8217;s where behaviour flags come in: they provide a controlled transition from the old behaviour to the new behaviour, allowing projects to opt into the new behaviour before it becomes the default and the old behaviour is removed.</p><p>Behaviour flags are defined in <em>dbt_project.yml </em>so the chosen behaviour affects all resources in a version-controlled project rather than relying on individual developers passing configuration through the command line</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="/__u/substackcdn.com/image/fetch/$s_!wpV4!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3941b7be-9f1b-484c-a0ba-ace8a270aaec_996x550.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="/__u/substackcdn.com/image/fetch/$s_!wpV4!, /__u/andrealeonel.substack.com/w_424, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3941b7be-9f1b-484c-a0ba-ace8a270aaec_996x550.png 424w, /__u/substackcdn.com/image/fetch/$s_!wpV4!, /__u/andrealeonel.substack.com/w_848, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3941b7be-9f1b-484c-a0ba-ace8a270aaec_996x550.png 848w, /__u/substackcdn.com/image/fetch/$s_!wpV4!, /__u/andrealeonel.substack.com/w_1272, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3941b7be-9f1b-484c-a0ba-ace8a270aaec_996x550.png 1272w, /__u/substackcdn.com/image/fetch/$s_!wpV4!, /__u/andrealeonel.substack.com/w_1456, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3941b7be-9f1b-484c-a0ba-ace8a270aaec_996x550.png 1456w" sizes="100vw"><img src="/__u/substackcdn.com/image/fetch/$s_!wpV4!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3941b7be-9f1b-484c-a0ba-ace8a270aaec_996x550.png" width="996" height="550" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/3941b7be-9f1b-484c-a0ba-ace8a270aaec_996x550.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:550,&quot;width&quot;:996,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:71878,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:&quot;https://andrealeonel.substack.com/i/212224734?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3941b7be-9f1b-484c-a0ba-ace8a270aaec_996x550.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="/__u/substackcdn.com/image/fetch/$s_!wpV4!, /__u/andrealeonel.substack.com/w_424, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3941b7be-9f1b-484c-a0ba-ace8a270aaec_996x550.png 424w, /__u/substackcdn.com/image/fetch/$s_!wpV4!, /__u/andrealeonel.substack.com/w_848, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3941b7be-9f1b-484c-a0ba-ace8a270aaec_996x550.png 848w, /__u/substackcdn.com/image/fetch/$s_!wpV4!, /__u/andrealeonel.substack.com/w_1272, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3941b7be-9f1b-484c-a0ba-ace8a270aaec_996x550.png 1272w, /__u/substackcdn.com/image/fetch/$s_!wpV4!, /__u/andrealeonel.substack.com/w_1456, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3941b7be-9f1b-484c-a0ba-ace8a270aaec_996x550.png 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption">Flags introduced in 2026. Source: <a href="https://docs.getdbt.com/reference/global-configs/behavior-changes?version=1.11#introduced-in-dbt-core-v1x">About behaviour changes</a></figcaption></figure></div><div><hr></div><h3>Let&#8217;s look at an example:</h3><p>The best way to understand this concept is to use one of the many <a href="https://docs.getdbt.com/reference/global-configs/behavior-changes?version=1.11#introduced-in-dbt-core-v1x">behaviour change flags</a> as an example: let&#8217;s pick <em><a href="https://docs.getdbt.com/reference/global-configs/behavior-flags/require_unique_project_resource_names?version=2">require_unique_project_resource_names</a>.</em></p><p>Starting in v1.11, dbt began enforcing that every resource in the project needs to have a unique name.</p><p>Previously, if a seed and a model in the same package were both named &#8220;customer&#8221; , dbt did not always reject the duplicate name. The project could therefore run, but a <em>ref()</em> or <em>source()</em> could potentially resolve to the wrong resource.</p><p>Now, the current behaviour depends on the stage of the flag and its set value.</p><h4>Flag stages</h4><p>Once dbt enforces a behaviour change, it goes through 3 stages:</p><ol><li><p>Introduced: the new behaviour is <strong>disabled </strong>by default with <em>require_unique_project_resource_names: false &#8594; </em>the old behaviour remains the default.</p></li><li><p>Mature: the new behaviour is <strong>enabled </strong>by default </p><p><em>require_unique_project_resource_names: true &#8594; </em>You can still preserve the old behaviour by explicitly setting the flag to <em>false</em>, but you may see deprecation warnings.</p></li><li><p>Removed: the old behaviour is removed from the dbt codebase and the flag may eventually be removed. dbt provides significant advance warning if a flag is going to be removed.</p></li></ol><p>Our example flag, <em>require_unique_project_resource_names, </em>is currently in the Mature stage, meaning the new behavior is the default. Projects containing duplicate resource names would encounter a <em>DuplicateNameDistinctNodeTypesDeprecation </em>warning.</p><div><hr></div><h3>Important: what isn&#8217;t a behaviour change</h3><p>Not every change in dbt is considered a behaviour change. Behaviour change flags are specifically used when dbt intentionally changes how existing project code behaves and needs to provide a transition between the old and new behaviour.</p><p>The following are not considered behaviour changes:</p><ul><li><p>Fixing a bug where the previous behaviour was defective, undesirable, or undocumented.</p></li><li><p>Adding a new warning where dbt previously did not raise one.</p></li><li><p>Changing the wording of human-friendly messages in log events.</p></li></ul><p> A behaviour change means dbt intentionally changes what your existing code does.</p>]]></content:encoded></item><item><title><![CDATA[Data product management]]></title><description><![CDATA[dbt's recommendations for building useful and scalable data products]]></description><link>https://andrealeonel.substack.com/p/data-product-management</link><guid isPermaLink="false">https://andrealeonel.substack.com/p/data-product-management</guid><pubDate>Fri, 17 Jul 2026 22:55:36 GMT</pubDate><enclosure url="https://images.unsplash.com/photo-1551288049-bebda4e38f71?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHw1fHxkYXRhJTIwbWFuYWdlbWVudCUyMHByb2R1Y3RzfGVufDB8fHx8MTc4NDMyODkwM3ww&amp;ixlib=rb-4.1.0&amp;q=80&amp;w=1080" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p><em>Part of the <a href="/__u/andrealeonel.substack.com/p/study-for-the-dbt-analytics-engineering">Mastering dbt</a> series. Access to the full <a href="/__u/andrealeonel.substack.com/p/dbt-analytics-engineering-certification">Study Guide</a>. Let&#8217;s connect on <a href="https://www.linkedin.com/in/andrealeonel/">LinkedIn</a>!<br>Notes from the <a href="https://www.getdbt.com/blog/data-product-management">Data Product Management</a> article.</em></p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://andrealeonel.substack.com/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption">Join hundreds of aspiring dbt developers &amp; data analysts!</p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div><p>This is not another technical post with screenshots of code and complex terminology. However, the processes around creating and maintaining a data product is no less important.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://images.unsplash.com/photo-1551288049-bebda4e38f71?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHw1fHxkYXRhJTIwbWFuYWdlbWVudCUyMHByb2R1Y3RzfGVufDB8fHx8MTc4NDMyODkwM3ww&amp;ixlib=rb-4.1.0&amp;q=80&amp;w=1080" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://images.unsplash.com/photo-1551288049-bebda4e38f71?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHw1fHxkYXRhJTIwbWFuYWdlbWVudCUyMHByb2R1Y3RzfGVufDB8fHx8MTc4NDMyODkwM3ww&amp;ixlib=rb-4.1.0&amp;q=80&amp;w=1080 424w, https://images.unsplash.com/photo-1551288049-bebda4e38f71?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHw1fHxkYXRhJTIwbWFuYWdlbWVudCUyMHByb2R1Y3RzfGVufDB8fHx8MTc4NDMyODkwM3ww&amp;ixlib=rb-4.1.0&amp;q=80&amp;w=1080 848w, https://images.unsplash.com/photo-1551288049-bebda4e38f71?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHw1fHxkYXRhJTIwbWFuYWdlbWVudCUyMHByb2R1Y3RzfGVufDB8fHx8MTc4NDMyODkwM3ww&amp;ixlib=rb-4.1.0&amp;q=80&amp;w=1080 1272w, https://images.unsplash.com/photo-1551288049-bebda4e38f71?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHw1fHxkYXRhJTIwbWFuYWdlbWVudCUyMHByb2R1Y3RzfGVufDB8fHx8MTc4NDMyODkwM3ww&amp;ixlib=rb-4.1.0&amp;q=80&amp;w=1080 1456w" sizes="100vw"><img src="https://images.unsplash.com/photo-1551288049-bebda4e38f71?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHw1fHxkYXRhJTIwbWFuYWdlbWVudCUyMHByb2R1Y3RzfGVufDB8fHx8MTc4NDMyODkwM3ww&amp;ixlib=rb-4.1.0&amp;q=80&amp;w=1080" width="4810" height="3207" data-attrs="{&quot;src&quot;:&quot;https://images.unsplash.com/photo-1551288049-bebda4e38f71?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHw1fHxkYXRhJTIwbWFuYWdlbWVudCUyMHByb2R1Y3RzfGVufDB8fHx8MTc4NDMyODkwM3ww&amp;ixlib=rb-4.1.0&amp;q=80&amp;w=1080&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:3207,&quot;width&quot;:4810,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;graphs of performance analytics on a laptop screen&quot;,&quot;title&quot;:null,&quot;type&quot;:&quot;image/jpg&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="graphs of performance analytics on a laptop screen" title="graphs of performance analytics on a laptop screen" srcset="https://images.unsplash.com/photo-1551288049-bebda4e38f71?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHw1fHxkYXRhJTIwbWFuYWdlbWVudCUyMHByb2R1Y3RzfGVufDB8fHx8MTc4NDMyODkwM3ww&amp;ixlib=rb-4.1.0&amp;q=80&amp;w=1080 424w, https://images.unsplash.com/photo-1551288049-bebda4e38f71?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHw1fHxkYXRhJTIwbWFuYWdlbWVudCUyMHByb2R1Y3RzfGVufDB8fHx8MTc4NDMyODkwM3ww&amp;ixlib=rb-4.1.0&amp;q=80&amp;w=1080 848w, https://images.unsplash.com/photo-1551288049-bebda4e38f71?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHw1fHxkYXRhJTIwbWFuYWdlbWVudCUyMHByb2R1Y3RzfGVufDB8fHx8MTc4NDMyODkwM3ww&amp;ixlib=rb-4.1.0&amp;q=80&amp;w=1080 1272w, https://images.unsplash.com/photo-1551288049-bebda4e38f71?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHw1fHxkYXRhJTIwbWFuYWdlbWVudCUyMHByb2R1Y3RzfGVufDB8fHx8MTc4NDMyODkwM3ww&amp;ixlib=rb-4.1.0&amp;q=80&amp;w=1080 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption">Photo by <a href="https://unsplash.com/@lukechesser">Luke Chesser</a> on <a href="https://unsplash.com">Unsplash</a></figcaption></figure></div><div><hr></div><h3>The issue at hand</h3><p>(I&#8217;m adding a bit of personal experience of 7+ years working in data teams)</p><p>Companies are growingly invested in developing a mature data environment from which they can drive productivity and ROI. However, in my experience, business may jump at the task without a full understanding of what it entails.</p><p>I always notice a strong focus on the technical suite. Which data warehouse should we use? What should we use for ingestion? What visualisation tool we are going to pick? Do we have personnel with the <em>technical</em> skills to deploy all this? </p><p>However, components that are essential for a mature data product are often overlooked. Governance, ownership, team processes. For me, these are the things that separate a data environment from a MATURE data environment.</p><p>The article mentions patchwork processes and this is a particular pet peeve of mine. When your team is constantly patching rather than sorting the issue at the souce, your data is creating more pointless work for you, rather than do what it is meant to do: enable productivity and free up analysts/scientists time to do more meaningful work.</p><p>Finally, for the aspiring analysts out there, you&#8217;d be surprised how immature data environments can be even in big multi-million dollar companies. For the smaller start-ups, often the eagerness to innovate bring about lack of governance. I&#8217;d go as far as saying is epidemic and, for that reason, it is so important that data professionals understand what a mature, scalable data environments should look like.</p><div><hr></div><h3>Best practices for data product management</h3><h4>Goals, metrics and user-centered design</h4><p>You data products should be aligned to business goals and aim to solve specific, quantifiable problems.</p><p>Teams should also monitor user engagement, adoption rate, and user satisfaction of the data products they create. I&#8217;d go one step further from the article and add maintanence cost to that list - not only in terms of money but resource too.</p><p>When designing a product, consider developing first a simplified version of it and gather feedback as the product evolves. Again, I&#8217;d make one addition here: be aware that a product is never 100% finished because needs and questions change and a good product evolves with the business.</p><h4>Defining, documenting, and discovering data products</h4><p>dbt recommends that a data product is always:</p><ul><li><p><strong>Discoverable</strong>: maintain a central catalog or marketplace for the products.</p></li><li><p><strong>Addressable and Interoperable</strong>: use naming conventions and standardised formats.</p></li><li><p><strong>Self-describing</strong>: create well-defined metadata for your products with business logic, ownership, purpose, and update frequency.</p></li><li><p><strong>Secure</strong>: use role-based access controls in the warehouse and row-level security in reporting.</p></li><li><p><strong>Properly documented</strong>: foster understanding and trust with a thoughtful description of the purpose of the data, the transformations applied, and the intended decision context.</p></li></ul><h4>Data quality and governance</h4><p>You can implement data governance by following the below principles.</p><ul><li><p><strong>Testing and checks:</strong> automate tests to ensure products meet the standards and expectations they were built around. Uniqueness checks for primary keys and relationship tests prevent report breaking while not-null constraints ensure data quality of required fields. CI/CD tests can avoid data errors making it to production.</p></li><li><p><strong>Lineage and stewardship: </strong>maintain traceability to make errors easier to sort out and their impact clearer. Assign data stewards for each domain and a data owner to troubleshoot failed tests, update policies, and communicate with stakeholders.</p></li></ul><h4>Cross-team collaboration and roles</h4><ul><li><p><strong>Establish roles: </strong>data roles should be clear with no unnecessary overlapping and respecting each roles&#8217; responsibilities.</p></li><li><p><strong>Build communication connections: </strong>implement communication networks between data teams and data-stakeholders. This can take the form of daily/weekly meetings, office hours, feedback surveys, etc.</p></li><li><p><strong>Use dbt&#8217;s collaboration tools</strong>: git integration, multi-environment deployment, and real-time slack notifications.</p></li></ul><h4>Agile iteration and prioritisation</h4><p>dbt describes an agile mindset as taking into consideration:</p><ul><li><p><strong>Early delivery</strong>: allow stakeholders to give you feedback and notice value with a small sample of the product before scaling. Use sprints and a prioritised backlog to make development organised and predictable. </p></li><li><p><strong>Feature flags: </strong>monitor usage of new functionality with feature flags or small-scale beta releases. Ensure even small changes undergo testing and adhere to governance criteria.</p></li><li><p><strong>Modular design: </strong>think modularly and implement an effective PR strategy.</p></li></ul><h4>Scalability, performance, and maintenance</h4><p>Increase the sustainability of your data products by implementing:</p><ul><li><p><strong>Performance tracking: </strong>observe query performance and resource utilisation to apply time and money saving fixes where needed. </p></li><li><p><strong>Domain ownership:</strong> create local expertise, balance workload out, and minimise dependency on a central team. </p></li></ul><h4>Monitoring, observability, and feedback</h4><p>Keep data relevant and trusted by performing:</p><ul><li><p><strong>Robust monitoring: </strong>set up alerts for test failures, sudden spikes in resource usage, or unexpected drops in data volume.</p></li><li><p><strong>User feedback: </strong>gather regular input through feedback tools or scheduled discussions to build trust and increase adoption.</p></li></ul>]]></content:encoded></item><item><title><![CDATA[Commands: dbt show and dbt retry]]></title><description><![CDATA[Two nice-to-have commands to make the developer's life easier.]]></description><link>https://andrealeonel.substack.com/p/commands-dbt-show-and-dbt-retry</link><guid isPermaLink="false">https://andrealeonel.substack.com/p/commands-dbt-show-and-dbt-retry</guid><pubDate>Fri, 10 Jul 2026 22:54:55 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!U33-!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F44edeb79-1bc2-4208-970c-47b0c7b2648a_1006x560.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p><em>Part of the <a href="/__u/andrealeonel.substack.com/p/study-for-the-dbt-analytics-engineering">Mastering dbt</a> series. Access to the full <a href="/__u/andrealeonel.substack.com/p/dbt-analytics-engineering-certification">Study Guide</a>. Let&#8217;s connect on <a href="https://www.linkedin.com/in/andrealeonel/">LinkedIn</a>!<br>Notes from the <a href="https://docs.getdbt.com/reference/commands/show?version=1.11&amp;name=Core">dbt show</a> and <a href="https://docs.getdbt.com/reference/commands/retry?version=2.0&amp;name=Fusion">dbt retry</a> documentation.</em></p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://andrealeonel.substack.com/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption">Join hundreds of aspiring dbt developers &amp; data analysts!</p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div><p>Let&#8217;s combine two non-essential but helpful commands that make the life of the developer easier. We&#8217;ll focus on dbt Core funcionalities as the exam is based on that version of dbt.</p><div><hr></div><h3>About the dbt show command</h3><p>The <em>dbt show </em>command is the closest equivalent to the Preview feature in dbt Cloud for dbt Core. Besides viewing query results in a readable format in the terminal, you can also use it to preview test failures, for instance.</p><p>It is a CLI command that compiles the SQL and executes it against the warehouse. You can only run it against a single node and it will query from the source, even if you already have the database relation materialised.  </p><p>By default, only 5 rows will be displayed. You can use the <em>limit</em> or the<em> inline </em>flag to tweak that.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="/__u/substackcdn.com/image/fetch/$s_!U33-!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F44edeb79-1bc2-4208-970c-47b0c7b2648a_1006x560.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="/__u/substackcdn.com/image/fetch/$s_!U33-!, /__u/andrealeonel.substack.com/w_424, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F44edeb79-1bc2-4208-970c-47b0c7b2648a_1006x560.png 424w, /__u/substackcdn.com/image/fetch/$s_!U33-!, /__u/andrealeonel.substack.com/w_848, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F44edeb79-1bc2-4208-970c-47b0c7b2648a_1006x560.png 848w, /__u/substackcdn.com/image/fetch/$s_!U33-!, /__u/andrealeonel.substack.com/w_1272, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F44edeb79-1bc2-4208-970c-47b0c7b2648a_1006x560.png 1272w, /__u/substackcdn.com/image/fetch/$s_!U33-!, /__u/andrealeonel.substack.com/w_1456, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F44edeb79-1bc2-4208-970c-47b0c7b2648a_1006x560.png 1456w" sizes="100vw"><img src="/__u/substackcdn.com/image/fetch/$s_!U33-!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F44edeb79-1bc2-4208-970c-47b0c7b2648a_1006x560.png" width="1006" height="560" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/44edeb79-1bc2-4208-970c-47b0c7b2648a_1006x560.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:560,&quot;width&quot;:1006,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:88930,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:&quot;https://andrealeonel.substack.com/i/206496882?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F44edeb79-1bc2-4208-970c-47b0c7b2648a_1006x560.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="/__u/substackcdn.com/image/fetch/$s_!U33-!, /__u/andrealeonel.substack.com/w_424, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F44edeb79-1bc2-4208-970c-47b0c7b2648a_1006x560.png 424w, /__u/substackcdn.com/image/fetch/$s_!U33-!, /__u/andrealeonel.substack.com/w_848, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F44edeb79-1bc2-4208-970c-47b0c7b2648a_1006x560.png 848w, /__u/substackcdn.com/image/fetch/$s_!U33-!, /__u/andrealeonel.substack.com/w_1272, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F44edeb79-1bc2-4208-970c-47b0c7b2648a_1006x560.png 1272w, /__u/substackcdn.com/image/fetch/$s_!U33-!, /__u/andrealeonel.substack.com/w_1456, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F44edeb79-1bc2-4208-970c-47b0c7b2648a_1006x560.png 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption">Source: <a href="https://docs.getdbt.com/reference/commands/show?version=1.11&amp;name=Core#example">dbt</a></figcaption></figure></div><h4>The limit flag</h4><p>By using this flag, dbt will wrap your query in a CTE and call it with a limit n clause.</p><h4>The inline flag</h4><p>This flags allow you to literally write the query in-line which helps with quick, one-off investigations you don&#8217;t want to create a model file for. The results won&#8217;t be stored in any dbt files or materialisations, except for dbt logs.</p><p>Because the query is in-line, dbt can&#8217;t guarantee that the query is going to modify the warehouse, so it&#8217;s recommended to use it with a read-only profile.</p><h4>The output json flag</h4><p>This flag returns the results in JSON format. You can also set <em>--log-format json </em>for the full terminal output, including logs. </p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="/__u/substackcdn.com/image/fetch/$s_!XeZX!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F54e2353b-59ac-49b2-893d-3e3f0dd09e37_986x573.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="/__u/substackcdn.com/image/fetch/$s_!XeZX!, /__u/andrealeonel.substack.com/w_424, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F54e2353b-59ac-49b2-893d-3e3f0dd09e37_986x573.png 424w, /__u/substackcdn.com/image/fetch/$s_!XeZX!, /__u/andrealeonel.substack.com/w_848, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F54e2353b-59ac-49b2-893d-3e3f0dd09e37_986x573.png 848w, /__u/substackcdn.com/image/fetch/$s_!XeZX!, /__u/andrealeonel.substack.com/w_1272, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F54e2353b-59ac-49b2-893d-3e3f0dd09e37_986x573.png 1272w, /__u/substackcdn.com/image/fetch/$s_!XeZX!, /__u/andrealeonel.substack.com/w_1456, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F54e2353b-59ac-49b2-893d-3e3f0dd09e37_986x573.png 1456w" sizes="100vw"><img src="/__u/substackcdn.com/image/fetch/$s_!XeZX!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F54e2353b-59ac-49b2-893d-3e3f0dd09e37_986x573.png" width="986" height="573" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/54e2353b-59ac-49b2-893d-3e3f0dd09e37_986x573.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:573,&quot;width&quot;:986,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:52143,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://andrealeonel.substack.com/i/206496882?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F54e2353b-59ac-49b2-893d-3e3f0dd09e37_986x573.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="/__u/substackcdn.com/image/fetch/$s_!XeZX!, /__u/andrealeonel.substack.com/w_424, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F54e2353b-59ac-49b2-893d-3e3f0dd09e37_986x573.png 424w, /__u/substackcdn.com/image/fetch/$s_!XeZX!, /__u/andrealeonel.substack.com/w_848, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F54e2353b-59ac-49b2-893d-3e3f0dd09e37_986x573.png 848w, /__u/substackcdn.com/image/fetch/$s_!XeZX!, /__u/andrealeonel.substack.com/w_1272, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F54e2353b-59ac-49b2-893d-3e3f0dd09e37_986x573.png 1272w, /__u/substackcdn.com/image/fetch/$s_!XeZX!, /__u/andrealeonel.substack.com/w_1456, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F54e2353b-59ac-49b2-893d-3e3f0dd09e37_986x573.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption"><code>dbt show --inline "select 1" --output json --log-format json
</code> Source: <a href="https://docs.getdbt.com/reference/commands/show?version=1.11&amp;name=Core#example">dbt</a></figcaption></figure></div><div><hr></div><h3>About the dbt retry command</h3><p>This command re-executes the last invocation from the last point of failure, using the run_results.json file to determine which node to start from. </p><p>It works against nodes that have been executed against the warehouse. If a previous run failed due to database connection/permission errors, <em>dbt retry </em>will not work as there are no recorded nodes. In these cases check your <em>run_results.json</em> files and manually re-run the full job.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="/__u/substackcdn.com/image/fetch/$s_!jL_8!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5c5da43b-6c9c-4208-9852-c66a86404a95_993x603.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="/__u/substackcdn.com/image/fetch/$s_!jL_8!, /__u/andrealeonel.substack.com/w_424, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5c5da43b-6c9c-4208-9852-c66a86404a95_993x603.png 424w, /__u/substackcdn.com/image/fetch/$s_!jL_8!, /__u/andrealeonel.substack.com/w_848, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5c5da43b-6c9c-4208-9852-c66a86404a95_993x603.png 848w, /__u/substackcdn.com/image/fetch/$s_!jL_8!, /__u/andrealeonel.substack.com/w_1272, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5c5da43b-6c9c-4208-9852-c66a86404a95_993x603.png 1272w, /__u/substackcdn.com/image/fetch/$s_!jL_8!, /__u/andrealeonel.substack.com/w_1456, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5c5da43b-6c9c-4208-9852-c66a86404a95_993x603.png 1456w" sizes="100vw"><img src="/__u/substackcdn.com/image/fetch/$s_!jL_8!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5c5da43b-6c9c-4208-9852-c66a86404a95_993x603.png" width="993" height="603" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/5c5da43b-6c9c-4208-9852-c66a86404a95_993x603.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:603,&quot;width&quot;:993,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:76939,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://andrealeonel.substack.com/i/206496882?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5c5da43b-6c9c-4208-9852-c66a86404a95_993x603.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="/__u/substackcdn.com/image/fetch/$s_!jL_8!, /__u/andrealeonel.substack.com/w_424, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5c5da43b-6c9c-4208-9852-c66a86404a95_993x603.png 424w, /__u/substackcdn.com/image/fetch/$s_!jL_8!, /__u/andrealeonel.substack.com/w_848, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5c5da43b-6c9c-4208-9852-c66a86404a95_993x603.png 848w, /__u/substackcdn.com/image/fetch/$s_!jL_8!, /__u/andrealeonel.substack.com/w_1272, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5c5da43b-6c9c-4208-9852-c66a86404a95_993x603.png 1272w, /__u/substackcdn.com/image/fetch/$s_!jL_8!, /__u/andrealeonel.substack.com/w_1456, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5c5da43b-6c9c-4208-9852-c66a86404a95_993x603.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption">Example of <em>dbt retry</em> run.Source: <a href="https://docs.getdbt.com/reference/commands/retry?version=2.0&amp;name=Fusion">dbt</a></figcaption></figure></div><p>If the previous run did not fail, <em>dbt retry </em>will return <em>no operation</em>.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="/__u/substackcdn.com/image/fetch/$s_!zFkx!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F159088c2-0cf6-4c9e-86fd-08b65d5374e1_988x272.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="/__u/substackcdn.com/image/fetch/$s_!zFkx!, /__u/andrealeonel.substack.com/w_424, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F159088c2-0cf6-4c9e-86fd-08b65d5374e1_988x272.png 424w, /__u/substackcdn.com/image/fetch/$s_!zFkx!, /__u/andrealeonel.substack.com/w_848, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F159088c2-0cf6-4c9e-86fd-08b65d5374e1_988x272.png 848w, /__u/substackcdn.com/image/fetch/$s_!zFkx!, /__u/andrealeonel.substack.com/w_1272, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F159088c2-0cf6-4c9e-86fd-08b65d5374e1_988x272.png 1272w, /__u/substackcdn.com/image/fetch/$s_!zFkx!, /__u/andrealeonel.substack.com/w_1456, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F159088c2-0cf6-4c9e-86fd-08b65d5374e1_988x272.png 1456w" sizes="100vw"><img src="/__u/substackcdn.com/image/fetch/$s_!zFkx!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F159088c2-0cf6-4c9e-86fd-08b65d5374e1_988x272.png" width="988" height="272" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/159088c2-0cf6-4c9e-86fd-08b65d5374e1_988x272.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:272,&quot;width&quot;:988,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:36934,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://andrealeonel.substack.com/i/206496882?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F159088c2-0cf6-4c9e-86fd-08b65d5374e1_988x272.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="/__u/substackcdn.com/image/fetch/$s_!zFkx!, /__u/andrealeonel.substack.com/w_424, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F159088c2-0cf6-4c9e-86fd-08b65d5374e1_988x272.png 424w, /__u/substackcdn.com/image/fetch/$s_!zFkx!, /__u/andrealeonel.substack.com/w_848, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F159088c2-0cf6-4c9e-86fd-08b65d5374e1_988x272.png 848w, /__u/substackcdn.com/image/fetch/$s_!zFkx!, /__u/andrealeonel.substack.com/w_1272, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F159088c2-0cf6-4c9e-86fd-08b65d5374e1_988x272.png 1272w, /__u/substackcdn.com/image/fetch/$s_!zFkx!, /__u/andrealeonel.substack.com/w_1456, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F159088c2-0cf6-4c9e-86fd-08b65d5374e1_988x272.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption">Running <em>dbt retry </em>after a successful dbt run. Source: <a href="https://docs.getdbt.com/reference/commands/retry?version=2.0&amp;name=Fusion">dbt</a></figcaption></figure></div><h4>Supported commands</h4><p>Retry works with: build, compile, clone, docs generate, seed, snapshot, test, run, and run-operation.</p><h4>Supported flags</h4><p>This command supports several flags in a local installation or in the IDE. For dbt Core, typically only <em>--threads</em> and <em>--vars</em> are supported. You can run <em>dbt retry help </em>for the full list of supported flags.</p><p>You can also use the standard <em>--select</em>, <em>--exclude</em> and <em>--selector </em>to limit nodes.</p><h4>The --threads flag</h4><p>Overrides the number of concurrent threads for the invocation.</p><h4>The --vars flag</h4><p>Passes project variables to the retried execution.</p>]]></content:encoded></item><item><title><![CDATA[The dbt build command]]></title><description><![CDATA[What it does and how to control its behaviour]]></description><link>https://andrealeonel.substack.com/p/the-dbt-build-command</link><guid isPermaLink="false">https://andrealeonel.substack.com/p/the-dbt-build-command</guid><pubDate>Fri, 03 Jul 2026 23:08:49 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!fQA5!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6e00b349-61f5-4f84-8eef-736df82e738f_1003x374.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p><em>Part of the <a href="/__u/andrealeonel.substack.com/p/study-for-the-dbt-analytics-engineering">Mastering dbt</a> series. Access to the full <a href="/__u/andrealeonel.substack.com/p/dbt-analytics-engineering-certification">Study Guide</a>. Let&#8217;s connect on <a href="https://www.linkedin.com/in/andrealeonel/">LinkedIn</a>!<br>Notes from the <a href="https://docs.getdbt.com/reference/commands/build?version=1.11&amp;name=Core">dbt build</a> documentation.</em></p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://andrealeonel.substack.com/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption">Join hundreds of aspiring dbt developers &amp; data analysts!</p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div><p>We have previously glossed over <a href="/__u/andrealeonel.substack.com/p/the-4-key-dbt-commands-and-node-selectors">the 4 key dbt commands</a>. Now, we will look at the most important command in more detail and understand how to control its behaviour with flags and methods.</p><div><hr></div><h3>What does it do?</h3><p>It includes all key actions for resource execution: parsing, compilation, and running.</p><p>Resources are processed in DAG order and users have the ability to use selection flags (<em>--select, --execute, --selector, --resource-type</em>)<em> </em>to build selected resources.</p><p>The task generates a single manifest and a single run results artifact.</p><div><hr></div><h3>The --empty flag</h3><p>The --empty flag is used for building schema-only dry runs. By adding this flag to <em>dbt build</em>, dbt will execute the models while limiting the refs and sources to zero rows. </p><p>This is useful if you only want to validate dependencies and ensure models build successfully without building the entire model in the data warehouse.</p><p>If you need certain <em>ref( )</em> and <em>source( ) </em>functions to be executed in order to avoid compilation errors, you can use the <em>.render( ) </em>method in the file.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="/__u/substackcdn.com/image/fetch/$s_!fQA5!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6e00b349-61f5-4f84-8eef-736df82e738f_1003x374.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="/__u/substackcdn.com/image/fetch/$s_!fQA5!, /__u/andrealeonel.substack.com/w_424, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6e00b349-61f5-4f84-8eef-736df82e738f_1003x374.png 424w, /__u/substackcdn.com/image/fetch/$s_!fQA5!, /__u/andrealeonel.substack.com/w_848, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6e00b349-61f5-4f84-8eef-736df82e738f_1003x374.png 848w, /__u/substackcdn.com/image/fetch/$s_!fQA5!, /__u/andrealeonel.substack.com/w_1272, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6e00b349-61f5-4f84-8eef-736df82e738f_1003x374.png 1272w, /__u/substackcdn.com/image/fetch/$s_!fQA5!, /__u/andrealeonel.substack.com/w_1456, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6e00b349-61f5-4f84-8eef-736df82e738f_1003x374.png 1456w" sizes="100vw"><img src="/__u/substackcdn.com/image/fetch/$s_!fQA5!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6e00b349-61f5-4f84-8eef-736df82e738f_1003x374.png" width="1003" height="374" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/6e00b349-61f5-4f84-8eef-736df82e738f_1003x374.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:374,&quot;width&quot;:1003,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:22556,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://andrealeonel.substack.com/i/204984847?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6e00b349-61f5-4f84-8eef-736df82e738f_1003x374.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="/__u/substackcdn.com/image/fetch/$s_!fQA5!, /__u/andrealeonel.substack.com/w_424, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6e00b349-61f5-4f84-8eef-736df82e738f_1003x374.png 424w, /__u/substackcdn.com/image/fetch/$s_!fQA5!, /__u/andrealeonel.substack.com/w_848, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6e00b349-61f5-4f84-8eef-736df82e738f_1003x374.png 848w, /__u/substackcdn.com/image/fetch/$s_!fQA5!, /__u/andrealeonel.substack.com/w_1272, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6e00b349-61f5-4f84-8eef-736df82e738f_1003x374.png 1272w, /__u/substackcdn.com/image/fetch/$s_!fQA5!, /__u/andrealeonel.substack.com/w_1456, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6e00b349-61f5-4f84-8eef-736df82e738f_1003x374.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption">Source: <a href="https://docs.getdbt.com/reference/commands/build?version=1.11&amp;name=Core">dbt</a></figcaption></figure></div><div><hr></div><h3>The --sample flag</h3><p>Available for <em>dbt</em> <em>run </em>and <em>dbt build</em>, this flag is a step further from the <em>--empty</em> flag as it adds a sample of the data to your development schema. It&#8217;s time-based and uses the <em>event_time </em>config used for some types of incremental materialisations.</p><p>Use this flag to reduce building times and warehouse spend when you only need enough data to validate the outputs.</p><p>You can limit the sample using hours, days, months, or years:</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="/__u/substackcdn.com/image/fetch/$s_!pOGx!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fca62a25b-6552-4ff0-8f7c-215d4a7ce984_995x95.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="/__u/substackcdn.com/image/fetch/$s_!pOGx!, /__u/andrealeonel.substack.com/w_424, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fca62a25b-6552-4ff0-8f7c-215d4a7ce984_995x95.png 424w, /__u/substackcdn.com/image/fetch/$s_!pOGx!, /__u/andrealeonel.substack.com/w_848, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fca62a25b-6552-4ff0-8f7c-215d4a7ce984_995x95.png 848w, /__u/substackcdn.com/image/fetch/$s_!pOGx!, /__u/andrealeonel.substack.com/w_1272, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fca62a25b-6552-4ff0-8f7c-215d4a7ce984_995x95.png 1272w, /__u/substackcdn.com/image/fetch/$s_!pOGx!, /__u/andrealeonel.substack.com/w_1456, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fca62a25b-6552-4ff0-8f7c-215d4a7ce984_995x95.png 1456w" sizes="100vw"><img src="/__u/substackcdn.com/image/fetch/$s_!pOGx!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fca62a25b-6552-4ff0-8f7c-215d4a7ce984_995x95.png" width="995" height="95" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/ca62a25b-6552-4ff0-8f7c-215d4a7ce984_995x95.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:95,&quot;width&quot;:995,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:8847,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://andrealeonel.substack.com/i/204984847?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fca62a25b-6552-4ff0-8f7c-215d4a7ce984_995x95.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="/__u/substackcdn.com/image/fetch/$s_!pOGx!, /__u/andrealeonel.substack.com/w_424, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fca62a25b-6552-4ff0-8f7c-215d4a7ce984_995x95.png 424w, /__u/substackcdn.com/image/fetch/$s_!pOGx!, /__u/andrealeonel.substack.com/w_848, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fca62a25b-6552-4ff0-8f7c-215d4a7ce984_995x95.png 848w, /__u/substackcdn.com/image/fetch/$s_!pOGx!, /__u/andrealeonel.substack.com/w_1272, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fca62a25b-6552-4ff0-8f7c-215d4a7ce984_995x95.png 1272w, /__u/substackcdn.com/image/fetch/$s_!pOGx!, /__u/andrealeonel.substack.com/w_1456, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fca62a25b-6552-4ff0-8f7c-215d4a7ce984_995x95.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a><figcaption class="image-caption">Source: <a href="https://docs.getdbt.com/docs/build/sample-flag?version=1.11&amp;name=Core">dbt</a></figcaption></figure></div><p>You can also set a start and end date:</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="/__u/substackcdn.com/image/fetch/$s_!_NV4!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb0f5114d-a853-4d64-948d-643ab3e1b494_998x81.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="/__u/substackcdn.com/image/fetch/$s_!_NV4!, /__u/andrealeonel.substack.com/w_424, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb0f5114d-a853-4d64-948d-643ab3e1b494_998x81.png 424w, /__u/substackcdn.com/image/fetch/$s_!_NV4!, /__u/andrealeonel.substack.com/w_848, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb0f5114d-a853-4d64-948d-643ab3e1b494_998x81.png 848w, /__u/substackcdn.com/image/fetch/$s_!_NV4!, /__u/andrealeonel.substack.com/w_1272, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb0f5114d-a853-4d64-948d-643ab3e1b494_998x81.png 1272w, /__u/substackcdn.com/image/fetch/$s_!_NV4!, /__u/andrealeonel.substack.com/w_1456, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb0f5114d-a853-4d64-948d-643ab3e1b494_998x81.png 1456w" sizes="100vw"><img src="/__u/substackcdn.com/image/fetch/$s_!_NV4!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb0f5114d-a853-4d64-948d-643ab3e1b494_998x81.png" width="998" height="81" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/b0f5114d-a853-4d64-948d-643ab3e1b494_998x81.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:81,&quot;width&quot;:998,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:10016,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://andrealeonel.substack.com/i/204984847?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb0f5114d-a853-4d64-948d-643ab3e1b494_998x81.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="/__u/substackcdn.com/image/fetch/$s_!_NV4!, /__u/andrealeonel.substack.com/w_424, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb0f5114d-a853-4d64-948d-643ab3e1b494_998x81.png 424w, /__u/substackcdn.com/image/fetch/$s_!_NV4!, /__u/andrealeonel.substack.com/w_848, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb0f5114d-a853-4d64-948d-643ab3e1b494_998x81.png 848w, /__u/substackcdn.com/image/fetch/$s_!_NV4!, /__u/andrealeonel.substack.com/w_1272, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb0f5114d-a853-4d64-948d-643ab3e1b494_998x81.png 1272w, /__u/substackcdn.com/image/fetch/$s_!_NV4!, /__u/andrealeonel.substack.com/w_1456, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb0f5114d-a853-4d64-948d-643ab3e1b494_998x81.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a><figcaption class="image-caption">Source: <a href="https://docs.getdbt.com/docs/build/sample-flag?version=1.11&amp;name=Core">dbt</a></figcaption></figure></div><p>Similarly to <em>--empty</em>, use <em>.render( ) </em>to prevent a ref from being sampled.</p><p>Lastly, this flag is not available for Python models. Also, Seeds referenced in the model are loaded in their entirety. </p><div><hr></div><h3>Building tests</h3><p>When building a model with tests configured for it, a test failure will cause downstream resources to skip entirely. </p><p>In the <a href="/__u/andrealeonel.substack.com/p/data-test-configurations">tests configuration</a> post, you can learn how to adjust configs like <em><a href="/__u/andrealeonel.substack.com/i/190379410/severity-errorif-warnif">severity</a></em><a href="/__u/andrealeonel.substack.com/i/190379410/severity-errorif-warnif">, </a><em><a href="/__u/andrealeonel.substack.com/i/190379410/severity-errorif-warnif">warn_if, </a></em><a href="/__u/andrealeonel.substack.com/i/190379410/severity-errorif-warnif">and </a><em><a href="/__u/andrealeonel.substack.com/i/190379410/severity-errorif-warnif">error_if</a> </em>to control this behaviour.</p><p>Tests also have a running order: unit tests &#8594; model is materialized &#8594; data tests. This avoids materialising models that will go on to fail their unit tests.</p><div><hr></div><h3>User-defined functions</h3><p>The newly released user-defined functions are also built with the <em>dbt build</em> command.</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="/__u/substackcdn.com/image/fetch/$s_!hUdt!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3afb76f2-c817-498c-b2a0-30ee3f68d7c6_993x174.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="/__u/substackcdn.com/image/fetch/$s_!hUdt!, /__u/andrealeonel.substack.com/w_424, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3afb76f2-c817-498c-b2a0-30ee3f68d7c6_993x174.png 424w, /__u/substackcdn.com/image/fetch/$s_!hUdt!, /__u/andrealeonel.substack.com/w_848, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3afb76f2-c817-498c-b2a0-30ee3f68d7c6_993x174.png 848w, /__u/substackcdn.com/image/fetch/$s_!hUdt!, /__u/andrealeonel.substack.com/w_1272, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3afb76f2-c817-498c-b2a0-30ee3f68d7c6_993x174.png 1272w, /__u/substackcdn.com/image/fetch/$s_!hUdt!, /__u/andrealeonel.substack.com/w_1456, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3afb76f2-c817-498c-b2a0-30ee3f68d7c6_993x174.png 1456w" sizes="100vw"><img src="/__u/substackcdn.com/image/fetch/$s_!hUdt!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3afb76f2-c817-498c-b2a0-30ee3f68d7c6_993x174.png" width="993" height="174" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/3afb76f2-c817-498c-b2a0-30ee3f68d7c6_993x174.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:174,&quot;width&quot;:993,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:32414,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://andrealeonel.substack.com/i/204984847?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3afb76f2-c817-498c-b2a0-30ee3f68d7c6_993x174.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="/__u/substackcdn.com/image/fetch/$s_!hUdt!, /__u/andrealeonel.substack.com/w_424, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3afb76f2-c817-498c-b2a0-30ee3f68d7c6_993x174.png 424w, /__u/substackcdn.com/image/fetch/$s_!hUdt!, /__u/andrealeonel.substack.com/w_848, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3afb76f2-c817-498c-b2a0-30ee3f68d7c6_993x174.png 848w, /__u/substackcdn.com/image/fetch/$s_!hUdt!, /__u/andrealeonel.substack.com/w_1272, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3afb76f2-c817-498c-b2a0-30ee3f68d7c6_993x174.png 1272w, /__u/substackcdn.com/image/fetch/$s_!hUdt!, /__u/andrealeonel.substack.com/w_1456, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3afb76f2-c817-498c-b2a0-30ee3f68d7c6_993x174.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a><figcaption class="image-caption">Source: <a href="https://docs.getdbt.com/reference/commands/build?version=1.11&amp;name=Core">dbt</a></figcaption></figure></div>]]></content:encoded></item><item><title><![CDATA[Analyses]]></title><description><![CDATA[Reduce clutter and version control exploratory sql with Analyses]]></description><link>https://andrealeonel.substack.com/p/analyses</link><guid isPermaLink="false">https://andrealeonel.substack.com/p/analyses</guid><pubDate>Fri, 03 Jul 2026 22:23:00 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!kdrx!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdcf993c6-31f2-4568-a83b-0041fb9b3e94_1000x572.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p><em>Part of the <a href="/__u/andrealeonel.substack.com/p/study-for-the-dbt-analytics-engineering">Mastering dbt</a> series. Access to the full <a href="/__u/andrealeonel.substack.com/p/dbt-analytics-engineering-certification">Study Guide</a>. Let&#8217;s connect on <a href="https://www.linkedin.com/in/andrealeonel/">LinkedIn</a>!<br>Notes from the <a href="https://docs.getdbt.com/docs/build/analyses?version=1.11&amp;name=Core">Analyses </a>and <a href="https://docs.getdbt.com/reference/analysis-properties?version=2.0&amp;name=Fusion">Analysis properties</a> documentation.</em></p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://andrealeonel.substack.com/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption">Join hundreds of aspiring dbt developers &amp; data analysts!</p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div><p>Analyses is a simple but very useful functionality dbt offers to help you keep exploratory sql organised, shareable across the team, and version controlled.</p><div><hr></div><h3>What are Analyses?</h3><p>Whilst you&#8217;re modelling data, you might need to do an exploratory analysis, data validation or one-off investigations of your sources or models. </p><p>Rather than storing these queries in model files&#8212;or losing track of them in your SQL editor&#8212;dbt provides the <em>analyses/</em> directory as a dedicated place to keep them under version control.</p><p>The special behaviour of this directory is: any sql files placed here will be compiled, but not executed.<br><br>This means that Jinja expressions such as <em>ref()</em> and <em>source()</em> are rendered into executable SQL. However, unlike models, analyses are not materialised in your data warehouse when you run them. You can execute the compiled SQL manually whenever you want to inspect the results.</p><p>Like with models, use <em>dbt compile </em>to compile the analysis into runnable sql. The generated sql file lives in the target directory.</p><div><hr></div><h3>Configuring Analyses</h3><p>dbt recommends developers to have a .yml file in the <em>analyses/</em> directory for proper configuration.<br><br>You can add documentation properties like file and column descriptions as well as assign tags to analyses.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="/__u/substackcdn.com/image/fetch/$s_!kdrx!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdcf993c6-31f2-4568-a83b-0041fb9b3e94_1000x572.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="/__u/substackcdn.com/image/fetch/$s_!kdrx!, /__u/andrealeonel.substack.com/w_424, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdcf993c6-31f2-4568-a83b-0041fb9b3e94_1000x572.png 424w, /__u/substackcdn.com/image/fetch/$s_!kdrx!, /__u/andrealeonel.substack.com/w_848, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdcf993c6-31f2-4568-a83b-0041fb9b3e94_1000x572.png 848w, /__u/substackcdn.com/image/fetch/$s_!kdrx!, /__u/andrealeonel.substack.com/w_1272, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdcf993c6-31f2-4568-a83b-0041fb9b3e94_1000x572.png 1272w, /__u/substackcdn.com/image/fetch/$s_!kdrx!, /__u/andrealeonel.substack.com/w_1456, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdcf993c6-31f2-4568-a83b-0041fb9b3e94_1000x572.png 1456w" sizes="100vw"><img src="/__u/substackcdn.com/image/fetch/$s_!kdrx!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdcf993c6-31f2-4568-a83b-0041fb9b3e94_1000x572.png" width="1000" height="572" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/dcf993c6-31f2-4568-a83b-0041fb9b3e94_1000x572.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:572,&quot;width&quot;:1000,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:68103,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://andrealeonel.substack.com/i/204982089?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdcf993c6-31f2-4568-a83b-0041fb9b3e94_1000x572.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="/__u/substackcdn.com/image/fetch/$s_!kdrx!, /__u/andrealeonel.substack.com/w_424, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdcf993c6-31f2-4568-a83b-0041fb9b3e94_1000x572.png 424w, /__u/substackcdn.com/image/fetch/$s_!kdrx!, /__u/andrealeonel.substack.com/w_848, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdcf993c6-31f2-4568-a83b-0041fb9b3e94_1000x572.png 848w, /__u/substackcdn.com/image/fetch/$s_!kdrx!, /__u/andrealeonel.substack.com/w_1272, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdcf993c6-31f2-4568-a83b-0041fb9b3e94_1000x572.png 1272w, /__u/substackcdn.com/image/fetch/$s_!kdrx!, /__u/andrealeonel.substack.com/w_1456, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdcf993c6-31f2-4568-a83b-0041fb9b3e94_1000x572.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption">Source: <a href="https://docs.getdbt.com/docs/build/analyses?version=1.11&amp;name=Core">dbt</a></figcaption></figure></div>]]></content:encoded></item><item><title><![CDATA[Incremental models: microbatch]]></title><description><![CDATA[A deep-dive into one of the incremental strategies offered in dbt.]]></description><link>https://andrealeonel.substack.com/p/incremental-models-microbatch</link><guid isPermaLink="false">https://andrealeonel.substack.com/p/incremental-models-microbatch</guid><pubDate>Fri, 26 Jun 2026 22:42:14 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!mmqB!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F348654a9-4b68-46d0-b1c0-3c79f1a6ed8f_994x508.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p><em>Part of the <a href="/__u/andrealeonel.substack.com/p/study-for-the-dbt-analytics-engineering">Mastering dbt</a> series. Access to the full <a href="/__u/andrealeonel.substack.com/p/dbt-analytics-engineering-certification">Study Guide</a>. Let&#8217;s connect on <a href="https://www.linkedin.com/in/andrealeonel/">LinkedIn</a>!<br>Notes from the <a href="https://docs.getdbt.com/docs/build/incremental-microbatch?version=1.11&amp;name=Core">microbatch incremental models</a> documentation.</em></p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://andrealeonel.substack.com/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption">Join hundreds of aspiring dbt developers &amp; data analysts!</p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div><p>Microbatch is one of the 5 <a href="/__u/andrealeonel.substack.com/p/incremental-materialisations">incremental strategies</a> available in dbt. </p><p>The basics of incremental refreshes have been covered previously, so this post will focus on this particular strategy and its relevant configs.</p><div><hr></div><h3>What is microbatch in dbt?</h3><p>The keyword here is: time-series.</p><p>Microbatch allows you to define time-based ranges for filtering and reducing the amount of data to be refreshed.</p><p>In this strategy, every unit of time (by default, a single day of data) is considered a batch. This batch can be built or replaced on its own, unlike other strategies that simply differentiate &#8220;old&#8221; from &#8220;new&#8221; data.<br><br>Therefore, the microbatch strategy allows you to run batches separately, concurrently and retry them independently.</p><div><hr></div><h3>How microbatch works</h3><p>This strategy requires an<em> event-time </em>column to be created in the model itself as well as all upstream models that need to be filtered. You can switch off filtering for time-based upstream models by specifying <em>ref('upstream_model').render()</em>, although this is not generally recommended.</p><p>Upstream models that do not have a reliable time-based column will undergo a full run with every refresh. </p><p>You also need to configure a <em>batch_size</em>, which tells dbt what unit of time you&#8217;d like your batches to be considered.</p><p>In the example below, <em>sessions.sql </em>is configured as a microbatch. It depends on the model <em>customers.sql </em>which is not time-based. Note that <em>event_time</em> was defined as the column <em>session_start</em> and the <em>batch_size = day</em>. </p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="/__u/substackcdn.com/image/fetch/$s_!y08m!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa4ebabf0-d1ba-4594-81ae-0b13109d8a88_952x321.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="/__u/substackcdn.com/image/fetch/$s_!y08m!, /__u/andrealeonel.substack.com/w_424, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa4ebabf0-d1ba-4594-81ae-0b13109d8a88_952x321.png 424w, /__u/substackcdn.com/image/fetch/$s_!y08m!, /__u/andrealeonel.substack.com/w_848, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa4ebabf0-d1ba-4594-81ae-0b13109d8a88_952x321.png 848w, /__u/substackcdn.com/image/fetch/$s_!y08m!, /__u/andrealeonel.substack.com/w_1272, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa4ebabf0-d1ba-4594-81ae-0b13109d8a88_952x321.png 1272w, /__u/substackcdn.com/image/fetch/$s_!y08m!, /__u/andrealeonel.substack.com/w_1456, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa4ebabf0-d1ba-4594-81ae-0b13109d8a88_952x321.png 1456w" sizes="100vw"><img src="/__u/substackcdn.com/image/fetch/$s_!y08m!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa4ebabf0-d1ba-4594-81ae-0b13109d8a88_952x321.png" width="952" height="321" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/a4ebabf0-d1ba-4594-81ae-0b13109d8a88_952x321.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:321,&quot;width&quot;:952,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:30918,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://andrealeonel.substack.com/i/203762005?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa4ebabf0-d1ba-4594-81ae-0b13109d8a88_952x321.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="/__u/substackcdn.com/image/fetch/$s_!y08m!, /__u/andrealeonel.substack.com/w_424, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa4ebabf0-d1ba-4594-81ae-0b13109d8a88_952x321.png 424w, /__u/substackcdn.com/image/fetch/$s_!y08m!, /__u/andrealeonel.substack.com/w_848, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa4ebabf0-d1ba-4594-81ae-0b13109d8a88_952x321.png 848w, /__u/substackcdn.com/image/fetch/$s_!y08m!, /__u/andrealeonel.substack.com/w_1272, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa4ebabf0-d1ba-4594-81ae-0b13109d8a88_952x321.png 1272w, /__u/substackcdn.com/image/fetch/$s_!y08m!, /__u/andrealeonel.substack.com/w_1456, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa4ebabf0-d1ba-4594-81ae-0b13109d8a88_952x321.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption">Source: <a href="https://docs.getdbt.com/docs/build/incremental-microbatch?version=1.11&amp;name=Core">dbt</a></figcaption></figure></div><p>When <em>sessions.sql </em>is run on October 2 2024, the following sql is compiled:</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="/__u/substackcdn.com/image/fetch/$s_!MVrW!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F53330f35-328d-42ca-856a-b98780a61a03_942x697.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="/__u/substackcdn.com/image/fetch/$s_!MVrW!, /__u/andrealeonel.substack.com/w_424, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F53330f35-328d-42ca-856a-b98780a61a03_942x697.png 424w, /__u/substackcdn.com/image/fetch/$s_!MVrW!, /__u/andrealeonel.substack.com/w_848, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F53330f35-328d-42ca-856a-b98780a61a03_942x697.png 848w, /__u/substackcdn.com/image/fetch/$s_!MVrW!, /__u/andrealeonel.substack.com/w_1272, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F53330f35-328d-42ca-856a-b98780a61a03_942x697.png 1272w, /__u/substackcdn.com/image/fetch/$s_!MVrW!, /__u/andrealeonel.substack.com/w_1456, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F53330f35-328d-42ca-856a-b98780a61a03_942x697.png 1456w" sizes="100vw"><img src="/__u/substackcdn.com/image/fetch/$s_!MVrW!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F53330f35-328d-42ca-856a-b98780a61a03_942x697.png" width="942" height="697" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/53330f35-328d-42ca-856a-b98780a61a03_942x697.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:697,&quot;width&quot;:942,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:60071,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://andrealeonel.substack.com/i/203762005?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F53330f35-328d-42ca-856a-b98780a61a03_942x697.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="/__u/substackcdn.com/image/fetch/$s_!MVrW!, /__u/andrealeonel.substack.com/w_424, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F53330f35-328d-42ca-856a-b98780a61a03_942x697.png 424w, /__u/substackcdn.com/image/fetch/$s_!MVrW!, /__u/andrealeonel.substack.com/w_848, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F53330f35-328d-42ca-856a-b98780a61a03_942x697.png 848w, /__u/substackcdn.com/image/fetch/$s_!MVrW!, /__u/andrealeonel.substack.com/w_1272, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F53330f35-328d-42ca-856a-b98780a61a03_942x697.png 1272w, /__u/substackcdn.com/image/fetch/$s_!MVrW!, /__u/andrealeonel.substack.com/w_1456, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F53330f35-328d-42ca-856a-b98780a61a03_942x697.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption">Source: <a href="https://docs.getdbt.com/docs/build/incremental-microbatch?version=1.11&amp;name=Core#required-configs-for-specific-adapters">dbt</a></figcaption></figure></div><p>Note how each batch generates a sql query that is run and loaded independently. dbt will take the result of each of batch and insert, update, or replace the contents of the <em>sessions</em> table, according to the most efficient mechanism of each operator.</p><p>The <em>customers </em>model, which doesn&#8217;t have a time-series, will be fully run each time.</p><div><hr></div><h3>Configurations</h3><p>The microbatch strategy has 3 required configurations and 2 optional ones. Please note, <a href="https://docs.getdbt.com/docs/build/incremental-microbatch?version=1.11&amp;name=Core#required-configs-for-specific-adapters">specific adapters may require additional config</a>.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="/__u/substackcdn.com/image/fetch/$s_!mmqB!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F348654a9-4b68-46d0-b1c0-3c79f1a6ed8f_994x508.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="/__u/substackcdn.com/image/fetch/$s_!mmqB!, /__u/andrealeonel.substack.com/w_424, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F348654a9-4b68-46d0-b1c0-3c79f1a6ed8f_994x508.png 424w, /__u/substackcdn.com/image/fetch/$s_!mmqB!, /__u/andrealeonel.substack.com/w_848, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F348654a9-4b68-46d0-b1c0-3c79f1a6ed8f_994x508.png 848w, /__u/substackcdn.com/image/fetch/$s_!mmqB!, /__u/andrealeonel.substack.com/w_1272, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F348654a9-4b68-46d0-b1c0-3c79f1a6ed8f_994x508.png 1272w, /__u/substackcdn.com/image/fetch/$s_!mmqB!, /__u/andrealeonel.substack.com/w_1456, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F348654a9-4b68-46d0-b1c0-3c79f1a6ed8f_994x508.png 1456w" sizes="100vw"><img src="/__u/substackcdn.com/image/fetch/$s_!mmqB!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F348654a9-4b68-46d0-b1c0-3c79f1a6ed8f_994x508.png" width="994" height="508" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/348654a9-4b68-46d0-b1c0-3c79f1a6ed8f_994x508.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:508,&quot;width&quot;:994,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:54146,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://andrealeonel.substack.com/i/203762005?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F348654a9-4b68-46d0-b1c0-3c79f1a6ed8f_994x508.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="/__u/substackcdn.com/image/fetch/$s_!mmqB!, /__u/andrealeonel.substack.com/w_424, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F348654a9-4b68-46d0-b1c0-3c79f1a6ed8f_994x508.png 424w, /__u/substackcdn.com/image/fetch/$s_!mmqB!, /__u/andrealeonel.substack.com/w_848, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F348654a9-4b68-46d0-b1c0-3c79f1a6ed8f_994x508.png 848w, /__u/substackcdn.com/image/fetch/$s_!mmqB!, /__u/andrealeonel.substack.com/w_1272, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F348654a9-4b68-46d0-b1c0-3c79f1a6ed8f_994x508.png 1272w, /__u/substackcdn.com/image/fetch/$s_!mmqB!, /__u/andrealeonel.substack.com/w_1456, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F348654a9-4b68-46d0-b1c0-3c79f1a6ed8f_994x508.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption">Source: <a href="https://docs.getdbt.com/docs/build/incremental-microbatch?version=1.11&amp;name=Core#required-configs-for-specific-adapters">dbt</a></figcaption></figure></div><h4>1. Event_time (required)</h4><p>Indicates the timestamp of the tracked event. Currently, only UTC is supported as a timezone.<br><br>As mentioned before, it&#8217;s wise to include this in every time-based upstream model to avoid full refreshes every time a downstream model is run.</p><h4>2. Begin (required)</h4><p>Useful for the initial build as well as any full refreshes. It determines the date from which the batches should be considered.</p><h4>3. Batch_size (required)</h4><p>The granularity of the batches. May be <em>hour</em>, <em>day</em>, <em>month</em>, or <em>year</em>.</p><h4>4. Lookback (optional)</h4><p>You can tell dbt to run X batches before the latest refresh to capture late-arriving records. </p><h4>5. Concurrent_batches (optional - currently only available in Snowflake)</h4><p>Set this to <em>true </em>if you want dbt to run batches in parallel or <em>false</em> if you want the batches to be run sequentially. <br><br>By default, dbt will auto-detect if batches can be run at the same time, according to the number of batches and available threads. Also, the first and the last batch will always be run on their own.<br><br><a href="https://docs.getdbt.com/docs/build/parallel-batch-execution?version=2.0&amp;name=Fusion#configure-concurrent_batches">Parallel running </a>offers faster processing but cannot be used in cases when the order in which the batches are processed matter. Cumulative metrics (like rolling totals) are an example of this.</p><div><hr></div><h3>Performing full refreshes on microbatch models</h3><p>dbt recommends configuring <em>full_refresh: false </em>for these models to ensure <em>--full-refresh </em>flags are ignored. </p><p>If you do need a full refresh to be performed, specify the <em>--event-time-start</em> and <em>--event-time-end</em>:</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="/__u/substackcdn.com/image/fetch/$s_!IFOo!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa592f3e6-26b9-45f0-8b3a-ac643a3246f5_997x115.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="/__u/substackcdn.com/image/fetch/$s_!IFOo!, /__u/andrealeonel.substack.com/w_424, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa592f3e6-26b9-45f0-8b3a-ac643a3246f5_997x115.png 424w, /__u/substackcdn.com/image/fetch/$s_!IFOo!, /__u/andrealeonel.substack.com/w_848, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa592f3e6-26b9-45f0-8b3a-ac643a3246f5_997x115.png 848w, /__u/substackcdn.com/image/fetch/$s_!IFOo!, /__u/andrealeonel.substack.com/w_1272, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa592f3e6-26b9-45f0-8b3a-ac643a3246f5_997x115.png 1272w, /__u/substackcdn.com/image/fetch/$s_!IFOo!, /__u/andrealeonel.substack.com/w_1456, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa592f3e6-26b9-45f0-8b3a-ac643a3246f5_997x115.png 1456w" sizes="100vw"><img src="/__u/substackcdn.com/image/fetch/$s_!IFOo!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa592f3e6-26b9-45f0-8b3a-ac643a3246f5_997x115.png" width="997" height="115" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/a592f3e6-26b9-45f0-8b3a-ac643a3246f5_997x115.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:115,&quot;width&quot;:997,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:13438,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://andrealeonel.substack.com/i/203762005?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa592f3e6-26b9-45f0-8b3a-ac643a3246f5_997x115.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="/__u/substackcdn.com/image/fetch/$s_!IFOo!, /__u/andrealeonel.substack.com/w_424, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa592f3e6-26b9-45f0-8b3a-ac643a3246f5_997x115.png 424w, /__u/substackcdn.com/image/fetch/$s_!IFOo!, /__u/andrealeonel.substack.com/w_848, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa592f3e6-26b9-45f0-8b3a-ac643a3246f5_997x115.png 848w, /__u/substackcdn.com/image/fetch/$s_!IFOo!, /__u/andrealeonel.substack.com/w_1272, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa592f3e6-26b9-45f0-8b3a-ac643a3246f5_997x115.png 1272w, /__u/substackcdn.com/image/fetch/$s_!IFOo!, /__u/andrealeonel.substack.com/w_1456, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa592f3e6-26b9-45f0-8b3a-ac643a3246f5_997x115.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a><figcaption class="image-caption">Source: <a href="https://docs.getdbt.com/docs/build/incremental-microbatch?version=1.11&amp;name=Core#required-configs-for-specific-adapters">dbt</a></figcaption></figure></div><div><hr></div><h3>Microbatch strategy vs. other incremental strategies</h3><p>As mentioned above, microbatching does not fit every use case but it offers a clear advantage over other incremental materialisations.</p><h4>Simpler configuration</h4><p>While other incremental strategies requires you to write custom sql to define what &#8220;new&#8221; means, microbatch does it for you with 3 simple (potentially 5 for additional control) configs.</p><p>Personally, I see this as a blessing and a curse. It&#8217;s simpler but doesn&#8217;t accommodate more bespoke cases where you may need to slice the data further.</p>]]></content:encoded></item><item><title><![CDATA[What's changing in the dbt Analytics Engineering Certification Exam?]]></title><description><![CDATA[Let's go through the 4 biggest changes in the new exam outline and access our updated Study Guide.]]></description><link>https://andrealeonel.substack.com/p/whats-changing-in-the-dbt-analytics</link><guid isPermaLink="false">https://andrealeonel.substack.com/p/whats-changing-in-the-dbt-analytics</guid><pubDate>Sun, 17 May 2026 18:37:32 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!S88M!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9047281c-e738-4ec6-bcea-70645217e366_800x423.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p><em>Part of the <a href="/__u/andrealeonel.substack.com/p/study-for-the-dbt-analytics-engineering">Mastering dbt</a> series. Access to the full <a href="/__u/andrealeonel.substack.com/p/dbt-analytics-engineering-certification">Study Guide</a>. Let&#8217;s connect on <a href="https://www.linkedin.com/in/andrealeonel/">LinkedIn</a>!</em></p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://andrealeonel.substack.com/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption">Join hundreds of aspiring dbt developers &amp; data analysts!</p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div><p>If you tuned into the dbt Coalesce in Oct 2025, you likely joined me in wondering when those new features would make their way into the <a href="https://www.getdbt.com/certifications/analytics-engineer-certification-exam-version-1-11">dbt Analytics Engineering Certification Exam</a>.</p><p>In late 2025, dbt released <a href="https://www.getdbt.com/confirmation/dbt-core-live-111-recording?submissionGuid=8953de59-259f-4a61-a85f-9f9118bd038a">dbt Core v1.11</a>, and, sure enough, as of 20th May 2026, the exam will begin targeting this version. Naturally, this impacted <a href="https://www.getdbt.com/dbt-assets/certifications/dbt-certificate-study-guide-version-1-11">the new exam outline</a> and what you should focus on while preparing for the exam.</p><p>In this post, I am going to outline these changes and what this means for our own  updated <a href="/__u/andrealeonel.substack.com/p/dbt-analytics-engineering-certification">Study Guide</a><em>.</em></p><div><hr></div><h3>The new dbt Core v1.11: dbt wants to be more than a SQL transformation tool</h3><p>More than just introducing new features, the new dbt Core is evolving from a mere SQL transformation framework to become a production analytics engineering platform.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="/__u/substackcdn.com/image/fetch/$s_!S88M!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9047281c-e738-4ec6-bcea-70645217e366_800x423.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="/__u/substackcdn.com/image/fetch/$s_!S88M!, /__u/andrealeonel.substack.com/w_424, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9047281c-e738-4ec6-bcea-70645217e366_800x423.jpeg 424w, /__u/substackcdn.com/image/fetch/$s_!S88M!, /__u/andrealeonel.substack.com/w_848, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9047281c-e738-4ec6-bcea-70645217e366_800x423.jpeg 848w, /__u/substackcdn.com/image/fetch/$s_!S88M!, /__u/andrealeonel.substack.com/w_1272, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9047281c-e738-4ec6-bcea-70645217e366_800x423.jpeg 1272w, /__u/substackcdn.com/image/fetch/$s_!S88M!, /__u/andrealeonel.substack.com/w_1456, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9047281c-e738-4ec6-bcea-70645217e366_800x423.jpeg 1456w" sizes="100vw"><img src="/__u/substackcdn.com/image/fetch/$s_!S88M!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9047281c-e738-4ec6-bcea-70645217e366_800x423.jpeg" width="800" height="423" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/9047281c-e738-4ec6-bcea-70645217e366_800x423.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:423,&quot;width&quot;:800,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;dbt Labs introduces native UDF support! With the release of dbt Core v1.11,  one of the most impactful additions for us data/analytics engineers is  first&#8209;class support for User&#8209;Defined Functions&#8230; | Diko Baken&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="dbt Labs introduces native UDF support! With the release of dbt Core v1.11,  one of the most impactful additions for us data/analytics engineers is  first&#8209;class support for User&#8209;Defined Functions&#8230; | Diko Baken" title="dbt Labs introduces native UDF support! With the release of dbt Core v1.11,  one of the most impactful additions for us data/analytics engineers is  first&#8209;class support for User&#8209;Defined Functions&#8230; | Diko Baken" srcset="/__u/substackcdn.com/image/fetch/$s_!S88M!, /__u/andrealeonel.substack.com/w_424, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9047281c-e738-4ec6-bcea-70645217e366_800x423.jpeg 424w, /__u/substackcdn.com/image/fetch/$s_!S88M!, /__u/andrealeonel.substack.com/w_848, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9047281c-e738-4ec6-bcea-70645217e366_800x423.jpeg 848w, /__u/substackcdn.com/image/fetch/$s_!S88M!, /__u/andrealeonel.substack.com/w_1272, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9047281c-e738-4ec6-bcea-70645217e366_800x423.jpeg 1272w, /__u/substackcdn.com/image/fetch/$s_!S88M!, /__u/andrealeonel.substack.com/w_1456, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9047281c-e738-4ec6-bcea-70645217e366_800x423.jpeg 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>The <a href="https://www.getdbt.com/blog/dbt-core-v1-11-is-ga">release article</a> states that dbt is now catering to the needs of teams who want to:</p><ul><li><p>standardise logic across their data stack </p></li><li><p>understand when they're adhering to the dbt standard and when they're doing something custom</p></li><li><p>benefit from better debugging and performance optimisations</p></li></ul><p>With this evolution, the exam naturally evolved as well.</p><p>Knowing how to use the standard features of dbt is no longer enough to get certified - those topics now sit mostly in the &#8220;fundamentals&#8221; layer.</p><p>Now, the expectation is that you understand how dbt behaves inside a real production pipeline: orchestration, state-aware execution, testing strategy, governance, incremental processing, failure handling, and operational troubleshooting. </p><p>The focus has shifted from &#8220;Can you build dbt models?&#8221; to &#8220;Can you operate dbt reliably as part of a larger data product?&#8221;</p><div><hr></div><h3>What&#8217;s changing in the exam outline?</h3><p>Although the biggest new feature of dbt Core v1.11 is the UDFs, this has yet to make the exam outline. However, there are still substantial changes that all aspiring certified developers should be mindful of.</p><p>The <a href="/__u/andrealeonel.substack.com/p/dbt-analytics-engineering-certification">Study Guide</a> has been fully updated to reflect these changes.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="/__u/substackcdn.com/image/fetch/$s_!Rn5w!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff1d7d8e2-a107-4019-978d-7d5719ba6dbd_889x558.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="/__u/substackcdn.com/image/fetch/$s_!Rn5w!, /__u/andrealeonel.substack.com/w_424, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff1d7d8e2-a107-4019-978d-7d5719ba6dbd_889x558.png 424w, /__u/substackcdn.com/image/fetch/$s_!Rn5w!, /__u/andrealeonel.substack.com/w_848, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff1d7d8e2-a107-4019-978d-7d5719ba6dbd_889x558.png 848w, /__u/substackcdn.com/image/fetch/$s_!Rn5w!, /__u/andrealeonel.substack.com/w_1272, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff1d7d8e2-a107-4019-978d-7d5719ba6dbd_889x558.png 1272w, /__u/substackcdn.com/image/fetch/$s_!Rn5w!, /__u/andrealeonel.substack.com/w_1456, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff1d7d8e2-a107-4019-978d-7d5719ba6dbd_889x558.png 1456w" sizes="100vw"><img src="/__u/substackcdn.com/image/fetch/$s_!Rn5w!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff1d7d8e2-a107-4019-978d-7d5719ba6dbd_889x558.png" width="889" height="558" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/f1d7d8e2-a107-4019-978d-7d5719ba6dbd_889x558.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:558,&quot;width&quot;:889,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:71934,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://andrealeonel.substack.com/i/198063399?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff1d7d8e2-a107-4019-978d-7d5719ba6dbd_889x558.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="/__u/substackcdn.com/image/fetch/$s_!Rn5w!, /__u/andrealeonel.substack.com/w_424, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff1d7d8e2-a107-4019-978d-7d5719ba6dbd_889x558.png 424w, /__u/substackcdn.com/image/fetch/$s_!Rn5w!, /__u/andrealeonel.substack.com/w_848, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff1d7d8e2-a107-4019-978d-7d5719ba6dbd_889x558.png 848w, /__u/substackcdn.com/image/fetch/$s_!Rn5w!, /__u/andrealeonel.substack.com/w_1272, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff1d7d8e2-a107-4019-978d-7d5719ba6dbd_889x558.png 1272w, /__u/substackcdn.com/image/fetch/$s_!Rn5w!, /__u/andrealeonel.substack.com/w_1456, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff1d7d8e2-a107-4019-978d-7d5719ba6dbd_889x558.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption"><a href="https://www.getdbt.com/dbt-certification">Source</a></figcaption></figure></div><h4>1. The Fundamentals have expanded</h4><p>What dbt considers as fundamental knowledge has changed. </p><p>Previously, the first Checkpoint was a deep-dive into the simplest parts of dbt, like sources and models - with a dedicated section to using SQL in business logic and git functionality.</p><p>Now, with the evolving state of data pipelines in the real world, dbt adds incremental materializations, snapshots and advanced flags to the Fundamentals.</p><p>Therefore, as a starting point, you should become very familiar with all the functionalities that dbt offers.</p><h4>2. Increased focus on model governance and debugging</h4><p>As dbt places itself as more than a SQL transformation tool, certified developers should know how to use its functionalities to prevent errors from happening and, when they do happen, to catch them early on.</p><p>Model access, versioning and contracts were already part of the previous exam. Debugging also had a light focus.</p><p>Now, besides covering these as functionalities, the new exam outline expects you to know of best practices and how to use flags to effectively catch errors before they hit production.</p><h4>3. Testing on steroids: unit tests are now part of the exam</h4><p>Testing has always been an important part of the dbt infrastructure and this has not changed.</p><p>In the new outline, unit testing is added as a topic. But not only that, certified developers should know how to create an efficient testing strategy that serves their data product.</p><h4>4. Decreased focus on dbt docs and advanced deployment</h4><p>While the topics above have become more important, dbt has decreased the focus on documentation and advanced deployment.</p><p>In the new outline, dbt docs is still mentioned as part of the long list of funcionalities under Fundamentals but with a much smaller focus than before.</p><p>As for advanced deployement, topics like environment variables, custom schema, and hooks have disappeared from the outline.</p><div><hr></div>]]></content:encoded></item><item><title><![CDATA[Leveraging the state method]]></title><description><![CDATA[Understanding how to use the state method and customise it to your project's needs]]></description><link>https://andrealeonel.substack.com/p/leveraging-the-state-method</link><guid isPermaLink="false">https://andrealeonel.substack.com/p/leveraging-the-state-method</guid><pubDate>Mon, 13 Apr 2026 00:21:28 GMT</pubDate><enclosure url="https://substack-post-media.s3.amazonaws.com/public/images/147e568b-2d16-4754-824f-44810a92f145_994x232.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p><em>Part of the <a href="/__u/andrealeonel.substack.com/p/study-for-the-dbt-analytics-engineering">Mastering dbt</a> series. Access to the full <a href="/__u/andrealeonel.substack.com/p/dbt-analytics-engineering-certification">Study Guide</a>. Let&#8217;s connect on <a href="https://www.linkedin.com/in/andrealeonel/">LinkedIn</a>!<br>Notes from the <a href="https://docs.getdbt.com/reference/node-selection/methods?version=1.10#state">state method</a> documentation.</em></p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://andrealeonel.substack.com/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption">Join hundreds of aspiring dbt developers &amp; data analysts!</p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div><p>As dbt projects scale, running the entire DAG for every change quickly becomes inefficient&#8212;both in time and compute cost. To solve this, dbt offers state-based selection, which enables you to compare your current project against a previous state and run only the resources that have changed.</p><p>In order to attain this, it uses the manifest.json file and the <em>--state </em>method. Learn exactly how this works and how to customise state-based selection to your needs. </p><div><hr></div><h3>The manifest file</h3><p>After executing a dbt command, a manifest.json file is created in the project&#8217;s target directory. Even if you&#8217;re only running specific nodes of the project, this file will contain a full description of your project&#8217;s resources and configurations. </p><p>The manifest file is used for analysing the project&#8217;s health, compiling the docs site, and allowing state comparison.</p><p>It&#8217;s important to remember that with every parsing, dbt overwrites the manifest file in the target directory. Therefore, you should never compare a project&#8217;s state to the target manifest, as it leads to incorrect or unreliable results (e.g., no changes detected or warnings about a missing manifest).</p><p>Instead, you can store artifacts from a previous run in a separate folder and use that path for state comparison.</p><div><hr></div><h3>State comparison</h3><p>The state method enables you to select nodes according to a comparison with previous versions of the project.</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="/__u/substackcdn.com/image/fetch/$s_!23k0!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F02aee65d-41c8-4040-b053-fb8067b23a5b_1006x229.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="/__u/substackcdn.com/image/fetch/$s_!23k0!, /__u/andrealeonel.substack.com/w_424, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F02aee65d-41c8-4040-b053-fb8067b23a5b_1006x229.png 424w, /__u/substackcdn.com/image/fetch/$s_!23k0!, /__u/andrealeonel.substack.com/w_848, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F02aee65d-41c8-4040-b053-fb8067b23a5b_1006x229.png 848w, /__u/substackcdn.com/image/fetch/$s_!23k0!, /__u/andrealeonel.substack.com/w_1272, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F02aee65d-41c8-4040-b053-fb8067b23a5b_1006x229.png 1272w, /__u/substackcdn.com/image/fetch/$s_!23k0!, /__u/andrealeonel.substack.com/w_1456, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F02aee65d-41c8-4040-b053-fb8067b23a5b_1006x229.png 1456w" sizes="100vw"><img src="/__u/substackcdn.com/image/fetch/$s_!23k0!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F02aee65d-41c8-4040-b053-fb8067b23a5b_1006x229.png" width="1006" height="229" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/02aee65d-41c8-4040-b053-fb8067b23a5b_1006x229.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:229,&quot;width&quot;:1006,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:50127,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://andrealeonel.substack.com/i/194016103?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F02aee65d-41c8-4040-b053-fb8067b23a5b_1006x229.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="/__u/substackcdn.com/image/fetch/$s_!23k0!, /__u/andrealeonel.substack.com/w_424, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F02aee65d-41c8-4040-b053-fb8067b23a5b_1006x229.png 424w, /__u/substackcdn.com/image/fetch/$s_!23k0!, /__u/andrealeonel.substack.com/w_848, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F02aee65d-41c8-4040-b053-fb8067b23a5b_1006x229.png 848w, /__u/substackcdn.com/image/fetch/$s_!23k0!, /__u/andrealeonel.substack.com/w_1272, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F02aee65d-41c8-4040-b053-fb8067b23a5b_1006x229.png 1272w, /__u/substackcdn.com/image/fetch/$s_!23k0!, /__u/andrealeonel.substack.com/w_1456, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F02aee65d-41c8-4040-b053-fb8067b23a5b_1006x229.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a><figcaption class="image-caption">Usage of the state method. Source: <a href="https://docs.getdbt.com/reference/node-selection/methods?version=1.10#state">state node selector method</a></figcaption></figure></div><p>The commands above are using <em>state:new </em>and <em>state:modified</em>, and dbt offers another two states.</p><ul><li><p><em>state:new </em>will only select new nodes, that is, nodes whose unique_id are not already included in the comparison manifest. Bear in mind that a test is a resource, so new tests in existing models will also be selected.</p></li><li><p><em>state:old </em>is the opposite of new, that is, it will select nodes that already exist in the manifest.</p></li><li><p><em>state:modified</em> selects existing models that have been modified.</p></li><li><p><em>state: unmodified</em> is the opposite of modified and runs all nodes that had no changes.</p></li></ul><div><hr></div><h3>Deep-dive into state:modified</h3><p>Due to the complexity and diversity of dbt projects, there are aspects to consider when using <em>state:modified </em>to ensure it meets your specific needs.</p><h4>Additional subselectors:</h4><p>You can specify which aspect of the node needs to be compared against the manifest using the following subselectors:</p><ul><li><p>state:modified.body &#8594; changes to the node&#8217;s body like in a SQL model or seed values.</p></li><li><p>state:modified.configs &#8594; selects resources whose configs have changed since the last manifest. These changes don&#8217;t include database, schema, and alias.</p></li><li><p>state:modified.relation &#8594; changes to database, schema, and alias.</p></li><li><p>state:modified.persisted_descriptions &#8594; changes to descriptions, but must have <em>persist_docs </em>enabled at each level.</p></li><li><p>state:modified.macros &#8594; changes to upstream macros called directly or indirectly.</p></li><li><p>state:modified.contract &#8594; resources whose contract has changed. In the case of breaking changes, an error will be thrown.</p></li></ul><p>If no subselectors are used, dbt will enforce all of the above, plus other resource-specific criteria such as freshness, quoting, and maturity.</p><h4>Impact of group changes:</h4><p>While running on <em>state:modified,</em> dbt will track node-level config changes, including group definitions, access permissions, deprecation dates, and latest_version.</p><p>If a <em>group </em>definition changes, the models affected will be caught under the <em>state:modified </em>selection. However, as the <em>group</em> configuration can be used to control resource access, this may cause breakage downstream.</p><p>Even if you update the group everywhere, dbt still flags these nodes as modified, and any resulting access or reference issues are detected during parsing or execution.</p><p><strong>Attention to partial parsing:</strong> with partial parsing enabled, dbt may not immediately detect downstream reference issues during parsing, but they will surface during execution (especially if downstream nodes are included in the run).</p><h4>The &#8220;nothing to do&#8221; error and selecting downstream resources:</h4><p>This error is thrown when dbt flags a node as modified, but nothing needs to be run (for instance, in the case of metadata-only changes).</p><p>The run will be successful, but things may still break downstream. That is why it is recommended to include downstream models using <em>state:modified+.</em></p><h4>Seed files behaviour:</h4><p>State comparison differs for seed files according to their size:</p><ul><li><p>Small seeds (&lt; 1 Mib): included only when the contents change,</p></li><li><p>Large seeds (&gt;= 1 Mib): included only when the seed file path changes.</p></li></ul>]]></content:encoded></item><item><title><![CDATA[Test command and handling dependencies]]></title><description><![CDATA[Building your tests and defining which dependencies will also be tested.]]></description><link>https://andrealeonel.substack.com/p/test-command-and-handling-dependencies</link><guid isPermaLink="false">https://andrealeonel.substack.com/p/test-command-and-handling-dependencies</guid><pubDate>Sat, 21 Mar 2026 19:53:33 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!RMU-!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9a2b3b1e-e036-4be7-ac98-4a020231bfd1_745x487.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p><em>Part of the <a href="/__u/andrealeonel.substack.com/p/study-for-the-dbt-analytics-engineering">Mastering dbt</a> series. Access to the full <a href="/__u/andrealeonel.substack.com/p/dbt-analytics-engineering-certification">Study Guide</a>. Let&#8217;s connect on <a href="https://www.linkedin.com/in/andrealeonel/">LinkedIn</a>!<br>Notes from the <a href="https://docs.getdbt.com/reference/commands/test?version=1.10">test command </a>and <a href="https://docs.getdbt.com/reference/node-selection/test-selection-examples?version=1.10">test selection </a>documentation.</em></p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://andrealeonel.substack.com/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption">Join hundreds of aspiring dbt developers &amp; data analysts!</p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div><p>In our last post dedicated to data tests, we are going to cover the test command and how to define how dbt handles tests in dependencies.</p><div><hr></div><h3>The dbt test command</h3><p>Once tests were declared and configured, you need to run <em>dbt test </em>to apply them and identify potentially failing records.</p><p>You can use the <em>--select</em> flag to run specific tests according to their type (data, unit, generic, or singular) and/or the model name.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="/__u/substackcdn.com/image/fetch/$s_!LszK!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F194ee66a-b887-4e86-9870-ce71265e2dd9_918x805.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="/__u/substackcdn.com/image/fetch/$s_!LszK!, /__u/andrealeonel.substack.com/w_424, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F194ee66a-b887-4e86-9870-ce71265e2dd9_918x805.png 424w, /__u/substackcdn.com/image/fetch/$s_!LszK!, /__u/andrealeonel.substack.com/w_848, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F194ee66a-b887-4e86-9870-ce71265e2dd9_918x805.png 848w, /__u/substackcdn.com/image/fetch/$s_!LszK!, /__u/andrealeonel.substack.com/w_1272, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F194ee66a-b887-4e86-9870-ce71265e2dd9_918x805.png 1272w, /__u/substackcdn.com/image/fetch/$s_!LszK!, /__u/andrealeonel.substack.com/w_1456, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F194ee66a-b887-4e86-9870-ce71265e2dd9_918x805.png 1456w" sizes="100vw"><img src="/__u/substackcdn.com/image/fetch/$s_!LszK!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F194ee66a-b887-4e86-9870-ce71265e2dd9_918x805.png" width="918" height="805" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/194ee66a-b887-4e86-9870-ce71265e2dd9_918x805.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:805,&quot;width&quot;:918,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:115484,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:&quot;https://andrealeonel.substack.com/i/191696934?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F194ee66a-b887-4e86-9870-ce71265e2dd9_918x805.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="/__u/substackcdn.com/image/fetch/$s_!LszK!, /__u/andrealeonel.substack.com/w_424, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F194ee66a-b887-4e86-9870-ce71265e2dd9_918x805.png 424w, /__u/substackcdn.com/image/fetch/$s_!LszK!, /__u/andrealeonel.substack.com/w_848, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F194ee66a-b887-4e86-9870-ce71265e2dd9_918x805.png 848w, /__u/substackcdn.com/image/fetch/$s_!LszK!, /__u/andrealeonel.substack.com/w_1272, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F194ee66a-b887-4e86-9870-ce71265e2dd9_918x805.png 1272w, /__u/substackcdn.com/image/fetch/$s_!LszK!, /__u/andrealeonel.substack.com/w_1456, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F194ee66a-b887-4e86-9870-ce71265e2dd9_918x805.png 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption">Source: <a href="https://docs.getdbt.com/reference/commands/test?version=1.10">test command</a></figcaption></figure></div><div><hr></div><h3>Defining how dbt tests dependencies</h3><p>Unlike other resources, tests upstream or downstream can be selected indirectly. You can use modes to choose how dbt handles tests in other models.</p><h4>Eager mode (default)</h4><p>This is the most inclusive option and the default mode. Which tests will be built?</p><ul><li><p>Tests referencing the selected nodes as well as those of their upstream AND downstream models, even if they don&#8217;t directly reference the selected nodes.</p></li></ul><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="/__u/substackcdn.com/image/fetch/$s_!RMU-!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9a2b3b1e-e036-4be7-ac98-4a020231bfd1_745x487.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="/__u/substackcdn.com/image/fetch/$s_!RMU-!, /__u/andrealeonel.substack.com/w_424, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9a2b3b1e-e036-4be7-ac98-4a020231bfd1_745x487.png 424w, /__u/substackcdn.com/image/fetch/$s_!RMU-!, /__u/andrealeonel.substack.com/w_848, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9a2b3b1e-e036-4be7-ac98-4a020231bfd1_745x487.png 848w, /__u/substackcdn.com/image/fetch/$s_!RMU-!, /__u/andrealeonel.substack.com/w_1272, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9a2b3b1e-e036-4be7-ac98-4a020231bfd1_745x487.png 1272w, /__u/substackcdn.com/image/fetch/$s_!RMU-!, /__u/andrealeonel.substack.com/w_1456, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9a2b3b1e-e036-4be7-ac98-4a020231bfd1_745x487.png 1456w" sizes="100vw"><img src="/__u/substackcdn.com/image/fetch/$s_!RMU-!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9a2b3b1e-e036-4be7-ac98-4a020231bfd1_745x487.png" width="745" height="487" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/9a2b3b1e-e036-4be7-ac98-4a020231bfd1_745x487.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:487,&quot;width&quot;:745,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:52446,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://andrealeonel.substack.com/i/191696934?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9a2b3b1e-e036-4be7-ac98-4a020231bfd1_745x487.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="/__u/substackcdn.com/image/fetch/$s_!RMU-!, /__u/andrealeonel.substack.com/w_424, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9a2b3b1e-e036-4be7-ac98-4a020231bfd1_745x487.png 424w, /__u/substackcdn.com/image/fetch/$s_!RMU-!, /__u/andrealeonel.substack.com/w_848, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9a2b3b1e-e036-4be7-ac98-4a020231bfd1_745x487.png 848w, /__u/substackcdn.com/image/fetch/$s_!RMU-!, /__u/andrealeonel.substack.com/w_1272, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9a2b3b1e-e036-4be7-ac98-4a020231bfd1_745x487.png 1272w, /__u/substackcdn.com/image/fetch/$s_!RMU-!, /__u/andrealeonel.substack.com/w_1456, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9a2b3b1e-e036-4be7-ac98-4a020231bfd1_745x487.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption">Source:<a href="https://docs.getdbt.com/reference/node-selection/test-selection-examples?version=1.10#indirect-selection-examples"> indirect selection examples</a></figcaption></figure></div><h4>Cautious mode</h4><p>This is the most exclusive option. The tests that are built are:</p><ul><li><p>Only the tests that exclusively reference the selected nodes.</p></li></ul><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="/__u/substackcdn.com/image/fetch/$s_!TRY2!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fadda84da-a532-4dfd-90da-fc50acde413d_747x484.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="/__u/substackcdn.com/image/fetch/$s_!TRY2!, /__u/andrealeonel.substack.com/w_424, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fadda84da-a532-4dfd-90da-fc50acde413d_747x484.png 424w, /__u/substackcdn.com/image/fetch/$s_!TRY2!, /__u/andrealeonel.substack.com/w_848, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fadda84da-a532-4dfd-90da-fc50acde413d_747x484.png 848w, /__u/substackcdn.com/image/fetch/$s_!TRY2!, /__u/andrealeonel.substack.com/w_1272, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fadda84da-a532-4dfd-90da-fc50acde413d_747x484.png 1272w, /__u/substackcdn.com/image/fetch/$s_!TRY2!, /__u/andrealeonel.substack.com/w_1456, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fadda84da-a532-4dfd-90da-fc50acde413d_747x484.png 1456w" sizes="100vw"><img src="/__u/substackcdn.com/image/fetch/$s_!TRY2!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fadda84da-a532-4dfd-90da-fc50acde413d_747x484.png" width="747" height="484" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/adda84da-a532-4dfd-90da-fc50acde413d_747x484.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:484,&quot;width&quot;:747,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:52831,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://andrealeonel.substack.com/i/191696934?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fadda84da-a532-4dfd-90da-fc50acde413d_747x484.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="/__u/substackcdn.com/image/fetch/$s_!TRY2!, /__u/andrealeonel.substack.com/w_424, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fadda84da-a532-4dfd-90da-fc50acde413d_747x484.png 424w, /__u/substackcdn.com/image/fetch/$s_!TRY2!, /__u/andrealeonel.substack.com/w_848, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fadda84da-a532-4dfd-90da-fc50acde413d_747x484.png 848w, /__u/substackcdn.com/image/fetch/$s_!TRY2!, /__u/andrealeonel.substack.com/w_1272, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fadda84da-a532-4dfd-90da-fc50acde413d_747x484.png 1272w, /__u/substackcdn.com/image/fetch/$s_!TRY2!, /__u/andrealeonel.substack.com/w_1456, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fadda84da-a532-4dfd-90da-fc50acde413d_747x484.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption">Source:<a href="https://docs.getdbt.com/reference/node-selection/test-selection-examples?version=1.10#indirect-selection-examples"> indirect selection</a></figcaption></figure></div><h4>Buildable mode</h4><p>This is a middle ground between Eager and Caution. Useful if you want to build a subset of your DAG without running into failures caused by unbuilt nodes in Eager mode. Includes the following:</p><ul><li><p>Tests that reference the current node as well as those of its ancestors, even if they don&#8217;t reference the selected nodes.</p></li></ul><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="/__u/substackcdn.com/image/fetch/$s_!Nzc3!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F63f1d811-8310-44f5-a6f8-521f4ebe2da0_750x487.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="/__u/substackcdn.com/image/fetch/$s_!Nzc3!, /__u/andrealeonel.substack.com/w_424, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F63f1d811-8310-44f5-a6f8-521f4ebe2da0_750x487.png 424w, /__u/substackcdn.com/image/fetch/$s_!Nzc3!, /__u/andrealeonel.substack.com/w_848, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F63f1d811-8310-44f5-a6f8-521f4ebe2da0_750x487.png 848w, /__u/substackcdn.com/image/fetch/$s_!Nzc3!, /__u/andrealeonel.substack.com/w_1272, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F63f1d811-8310-44f5-a6f8-521f4ebe2da0_750x487.png 1272w, /__u/substackcdn.com/image/fetch/$s_!Nzc3!, /__u/andrealeonel.substack.com/w_1456, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F63f1d811-8310-44f5-a6f8-521f4ebe2da0_750x487.png 1456w" sizes="100vw"><img src="/__u/substackcdn.com/image/fetch/$s_!Nzc3!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F63f1d811-8310-44f5-a6f8-521f4ebe2da0_750x487.png" width="750" height="487" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/63f1d811-8310-44f5-a6f8-521f4ebe2da0_750x487.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:487,&quot;width&quot;:750,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:51705,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://andrealeonel.substack.com/i/191696934?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F63f1d811-8310-44f5-a6f8-521f4ebe2da0_750x487.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="/__u/substackcdn.com/image/fetch/$s_!Nzc3!, /__u/andrealeonel.substack.com/w_424, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F63f1d811-8310-44f5-a6f8-521f4ebe2da0_750x487.png 424w, /__u/substackcdn.com/image/fetch/$s_!Nzc3!, /__u/andrealeonel.substack.com/w_848, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F63f1d811-8310-44f5-a6f8-521f4ebe2da0_750x487.png 848w, /__u/substackcdn.com/image/fetch/$s_!Nzc3!, /__u/andrealeonel.substack.com/w_1272, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F63f1d811-8310-44f5-a6f8-521f4ebe2da0_750x487.png 1272w, /__u/substackcdn.com/image/fetch/$s_!Nzc3!, /__u/andrealeonel.substack.com/w_1456, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F63f1d811-8310-44f5-a6f8-521f4ebe2da0_750x487.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption">Source: <a href="https://docs.getdbt.com/reference/node-selection/test-selection-examples?version=1.10#indirect-selection-examples">indirect selection</a></figcaption></figure></div><h4>Empty mode</h4><p>Ignores all tests.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="/__u/substackcdn.com/image/fetch/$s_!QhxK!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8faca2e2-b098-417d-b923-8395d7927368_748x486.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="/__u/substackcdn.com/image/fetch/$s_!QhxK!, /__u/andrealeonel.substack.com/w_424, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8faca2e2-b098-417d-b923-8395d7927368_748x486.png 424w, /__u/substackcdn.com/image/fetch/$s_!QhxK!, /__u/andrealeonel.substack.com/w_848, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8faca2e2-b098-417d-b923-8395d7927368_748x486.png 848w, /__u/substackcdn.com/image/fetch/$s_!QhxK!, /__u/andrealeonel.substack.com/w_1272, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8faca2e2-b098-417d-b923-8395d7927368_748x486.png 1272w, /__u/substackcdn.com/image/fetch/$s_!QhxK!, /__u/andrealeonel.substack.com/w_1456, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8faca2e2-b098-417d-b923-8395d7927368_748x486.png 1456w" sizes="100vw"><img src="/__u/substackcdn.com/image/fetch/$s_!QhxK!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8faca2e2-b098-417d-b923-8395d7927368_748x486.png" width="748" height="486" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/8faca2e2-b098-417d-b923-8395d7927368_748x486.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:486,&quot;width&quot;:748,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:49858,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://andrealeonel.substack.com/i/191696934?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8faca2e2-b098-417d-b923-8395d7927368_748x486.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="/__u/substackcdn.com/image/fetch/$s_!QhxK!, /__u/andrealeonel.substack.com/w_424, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8faca2e2-b098-417d-b923-8395d7927368_748x486.png 424w, /__u/substackcdn.com/image/fetch/$s_!QhxK!, /__u/andrealeonel.substack.com/w_848, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8faca2e2-b098-417d-b923-8395d7927368_748x486.png 848w, /__u/substackcdn.com/image/fetch/$s_!QhxK!, /__u/andrealeonel.substack.com/w_1272, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8faca2e2-b098-417d-b923-8395d7927368_748x486.png 1272w, /__u/substackcdn.com/image/fetch/$s_!QhxK!, /__u/andrealeonel.substack.com/w_1456, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8faca2e2-b098-417d-b923-8395d7927368_748x486.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption">Source: <a href="https://docs.getdbt.com/reference/node-selection/test-selection-examples?version=1.10&amp;indirect-selection-mode=empty#indirect-selection-examples">indirect selection</a></figcaption></figure></div>]]></content:encoded></item><item><title><![CDATA[Data Test Configurations]]></title><description><![CDATA[Configuring your data tests and customising their behaviour.]]></description><link>https://andrealeonel.substack.com/p/data-test-configurations</link><guid isPermaLink="false">https://andrealeonel.substack.com/p/data-test-configurations</guid><pubDate>Mon, 09 Mar 2026 13:43:31 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!dBr_!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2ae97463-ece8-4255-a546-4c3b4d3b385b_894x339.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p><em>Part of the <a href="/__u/andrealeonel.substack.com/p/study-for-the-dbt-analytics-engineering">Mastering dbt</a> series. Access to the full <a href="/__u/andrealeonel.substack.com/p/dbt-analytics-engineering-certification">Study Guide</a>. Let&#8217;s connect on <a href="https://www.linkedin.com/in/andrealeonel/">LinkedIn</a>!<br>Notes from the <a href="https://docs.getdbt.com/reference/data-test-configs">Data test configurations</a><a href="https://docs.getdbt.com/reference/resource-properties/data-tests"> </a>documentation.</em></p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://andrealeonel.substack.com/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption">Join hundreds of aspiring dbt developers &amp; data analysts!</p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div><p>Let&#8217;s cover the possibilities around configuring your tests and deep-dive into customisation options to handle large datasets and set default paths for stored failures.</p><div><hr></div><h3>Where to define data test configurations</h3><p>Data tests can be configured in:</p><ol><li><p>under the <em>config:</em> method nested inside properties - this is for generic tests only.</p></li><li><p>inside a <em>config() </em>block within the test&#8217;s SQL definition.</p></li><li><p>in the dbt_project.yml file.</p></li></ol><p>The config inside the dbt_project.yml file is always the last precedence, however the hierarchy differs for singular and generic tests:</p><ul><li><p>Generic tests: (1) takes precedence over (2)</p></li><li><p>Singular test: (2) takes precedence over (1)</p></li></ul><div><hr></div><h3>Resource-specific configurations</h3><p>The following configs are available specifically for data tests:</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="/__u/substackcdn.com/image/fetch/$s_!dBr_!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2ae97463-ece8-4255-a546-4c3b4d3b385b_894x339.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="/__u/substackcdn.com/image/fetch/$s_!dBr_!, /__u/andrealeonel.substack.com/w_424, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2ae97463-ece8-4255-a546-4c3b4d3b385b_894x339.png 424w, /__u/substackcdn.com/image/fetch/$s_!dBr_!, /__u/andrealeonel.substack.com/w_848, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2ae97463-ece8-4255-a546-4c3b4d3b385b_894x339.png 848w, /__u/substackcdn.com/image/fetch/$s_!dBr_!, /__u/andrealeonel.substack.com/w_1272, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2ae97463-ece8-4255-a546-4c3b4d3b385b_894x339.png 1272w, /__u/substackcdn.com/image/fetch/$s_!dBr_!, /__u/andrealeonel.substack.com/w_1456, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2ae97463-ece8-4255-a546-4c3b4d3b385b_894x339.png 1456w" sizes="100vw"><img src="/__u/substackcdn.com/image/fetch/$s_!dBr_!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2ae97463-ece8-4255-a546-4c3b4d3b385b_894x339.png" width="894" height="339" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/2ae97463-ece8-4255-a546-4c3b4d3b385b_894x339.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:339,&quot;width&quot;:894,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:54084,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://andrealeonel.substack.com/i/190379410?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2ae97463-ece8-4255-a546-4c3b4d3b385b_894x339.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="/__u/substackcdn.com/image/fetch/$s_!dBr_!, /__u/andrealeonel.substack.com/w_424, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2ae97463-ece8-4255-a546-4c3b4d3b385b_894x339.png 424w, /__u/substackcdn.com/image/fetch/$s_!dBr_!, /__u/andrealeonel.substack.com/w_848, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2ae97463-ece8-4255-a546-4c3b4d3b385b_894x339.png 848w, /__u/substackcdn.com/image/fetch/$s_!dBr_!, /__u/andrealeonel.substack.com/w_1272, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2ae97463-ece8-4255-a546-4c3b4d3b385b_894x339.png 1272w, /__u/substackcdn.com/image/fetch/$s_!dBr_!, /__u/andrealeonel.substack.com/w_1456, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2ae97463-ece8-4255-a546-4c3b4d3b385b_894x339.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption">Data tests configs set up under properties in a .yml file. Source: <a href="https://docs.getdbt.com/reference/data-test-configs">Data Tests Configurations</a></figcaption></figure></div><p>Let&#8217;s define each one of these configs:</p><h4>fail_calc:</h4><p>All tests return the set of records that fail the assertion. By default, dbt returns the count(*) of records.</p><p>This config allows you to change this calculation. For instance, for a test that checks for duplicate records, you can set <em>fail_calc</em> to "case when count(*) &gt; 0 then sum(n_records) else 0 end".</p><p>If this calculation returns an error, like a data type error, the test won&#8217;t pass or fail, but it will return an error.</p><h4>limit:</h4><p>Limit the number of failures returned, specifically useful for large datasets and when failures are being stored in the database.</p><p>Example: &#8220;limit: 1000&#8221;</p><h4>severity, error_if, warn_if:</h4><p>By default, when even a single record fails the assertion, the tests will produce errors and prevent the model from running. This config allows you to add some leniency to your tests.</p><p>When you set up the <em>severity: </em>config to <em>error,</em> dbt will look for the <em>error_if</em> and <em>warn_if</em> configs, which will set up the conditions to bring an error or a warning:</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="/__u/substackcdn.com/image/fetch/$s_!xF9y!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F66efcd7c-c1c8-4db0-8975-a96b9a985922_901x294.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="/__u/substackcdn.com/image/fetch/$s_!xF9y!, /__u/andrealeonel.substack.com/w_424, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F66efcd7c-c1c8-4db0-8975-a96b9a985922_901x294.png 424w, /__u/substackcdn.com/image/fetch/$s_!xF9y!, /__u/andrealeonel.substack.com/w_848, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F66efcd7c-c1c8-4db0-8975-a96b9a985922_901x294.png 848w, /__u/substackcdn.com/image/fetch/$s_!xF9y!, /__u/andrealeonel.substack.com/w_1272, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F66efcd7c-c1c8-4db0-8975-a96b9a985922_901x294.png 1272w, /__u/substackcdn.com/image/fetch/$s_!xF9y!, /__u/andrealeonel.substack.com/w_1456, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F66efcd7c-c1c8-4db0-8975-a96b9a985922_901x294.png 1456w" sizes="100vw"><img src="/__u/substackcdn.com/image/fetch/$s_!xF9y!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F66efcd7c-c1c8-4db0-8975-a96b9a985922_901x294.png" width="901" height="294" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/66efcd7c-c1c8-4db0-8975-a96b9a985922_901x294.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:294,&quot;width&quot;:901,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:19513,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://andrealeonel.substack.com/i/190379410?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F66efcd7c-c1c8-4db0-8975-a96b9a985922_901x294.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="/__u/substackcdn.com/image/fetch/$s_!xF9y!, /__u/andrealeonel.substack.com/w_424, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F66efcd7c-c1c8-4db0-8975-a96b9a985922_901x294.png 424w, /__u/substackcdn.com/image/fetch/$s_!xF9y!, /__u/andrealeonel.substack.com/w_848, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F66efcd7c-c1c8-4db0-8975-a96b9a985922_901x294.png 848w, /__u/substackcdn.com/image/fetch/$s_!xF9y!, /__u/andrealeonel.substack.com/w_1272, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F66efcd7c-c1c8-4db0-8975-a96b9a985922_901x294.png 1272w, /__u/substackcdn.com/image/fetch/$s_!xF9y!, /__u/andrealeonel.substack.com/w_1456, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F66efcd7c-c1c8-4db0-8975-a96b9a985922_901x294.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption">This config tells dbt to warn if the number of failed records is between 11 and 999 and to error if it&#8217;s above 1000. Source: <a href="https://docs.getdbt.com/reference/resource-configs/severity">Severity</a></figcaption></figure></div><p>If <em>severity: </em>is set to <em>warn, </em>then dbt skips the <em>error_if </em>config and only considers <em>warn_if. </em>As with warnings of any nature, dbt will not fail the run, but you can promote warnings to errors using the <em>--warn-error</em> flag when running the models.</p><h4>store_failures:</h4><p>Optionally set a test to always or never store failures in the database. By default, the failed results will be stored in a schema named _<em>dbt_test__audit</em>, but this can be customised.</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="/__u/substackcdn.com/image/fetch/$s_!nPBS!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa0e3ee2f-de1e-4251-a8ad-517bda597d99_928x127.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="/__u/substackcdn.com/image/fetch/$s_!nPBS!, /__u/andrealeonel.substack.com/w_424, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa0e3ee2f-de1e-4251-a8ad-517bda597d99_928x127.png 424w, /__u/substackcdn.com/image/fetch/$s_!nPBS!, /__u/andrealeonel.substack.com/w_848, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa0e3ee2f-de1e-4251-a8ad-517bda597d99_928x127.png 848w, /__u/substackcdn.com/image/fetch/$s_!nPBS!, /__u/andrealeonel.substack.com/w_1272, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa0e3ee2f-de1e-4251-a8ad-517bda597d99_928x127.png 1272w, /__u/substackcdn.com/image/fetch/$s_!nPBS!, /__u/andrealeonel.substack.com/w_1456, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa0e3ee2f-de1e-4251-a8ad-517bda597d99_928x127.png 1456w" sizes="100vw"><img src="/__u/substackcdn.com/image/fetch/$s_!nPBS!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa0e3ee2f-de1e-4251-a8ad-517bda597d99_928x127.png" width="928" height="127" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/a0e3ee2f-de1e-4251-a8ad-517bda597d99_928x127.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:127,&quot;width&quot;:928,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:14304,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://andrealeonel.substack.com/i/190379410?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa0e3ee2f-de1e-4251-a8ad-517bda597d99_928x127.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="/__u/substackcdn.com/image/fetch/$s_!nPBS!, /__u/andrealeonel.substack.com/w_424, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa0e3ee2f-de1e-4251-a8ad-517bda597d99_928x127.png 424w, /__u/substackcdn.com/image/fetch/$s_!nPBS!, /__u/andrealeonel.substack.com/w_848, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa0e3ee2f-de1e-4251-a8ad-517bda597d99_928x127.png 848w, /__u/substackcdn.com/image/fetch/$s_!nPBS!, /__u/andrealeonel.substack.com/w_1272, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa0e3ee2f-de1e-4251-a8ad-517bda597d99_928x127.png 1272w, /__u/substackcdn.com/image/fetch/$s_!nPBS!, /__u/andrealeonel.substack.com/w_1456, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa0e3ee2f-de1e-4251-a8ad-517bda597d99_928x127.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a><figcaption class="image-caption">Enabling store_failures under a custom schema. Source: <a href="https://docs.getdbt.com/reference/resource-configs/schema#tests">Schema - Data Tests</a></figcaption></figure></div><p>Ensure you have the correct permissions to create schemas in the database. </p><h4>where:</h4><p>Allows you to limit the records being tested. For instance, you can tell dbt to only test the assertion on records for which column A is not null. </p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="/__u/substackcdn.com/image/fetch/$s_!7Wuz!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F80a129d2-0590-4be5-a04c-ad1ad20a3823_892x208.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="/__u/substackcdn.com/image/fetch/$s_!7Wuz!, /__u/andrealeonel.substack.com/w_424, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F80a129d2-0590-4be5-a04c-ad1ad20a3823_892x208.png 424w, /__u/substackcdn.com/image/fetch/$s_!7Wuz!, /__u/andrealeonel.substack.com/w_848, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F80a129d2-0590-4be5-a04c-ad1ad20a3823_892x208.png 848w, /__u/substackcdn.com/image/fetch/$s_!7Wuz!, /__u/andrealeonel.substack.com/w_1272, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F80a129d2-0590-4be5-a04c-ad1ad20a3823_892x208.png 1272w, /__u/substackcdn.com/image/fetch/$s_!7Wuz!, /__u/andrealeonel.substack.com/w_1456, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F80a129d2-0590-4be5-a04c-ad1ad20a3823_892x208.png 1456w" sizes="100vw"><img src="/__u/substackcdn.com/image/fetch/$s_!7Wuz!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F80a129d2-0590-4be5-a04c-ad1ad20a3823_892x208.png" width="892" height="208" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/80a129d2-0590-4be5-a04c-ad1ad20a3823_892x208.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:208,&quot;width&quot;:892,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:15328,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://andrealeonel.substack.com/i/190379410?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F80a129d2-0590-4be5-a04c-ad1ad20a3823_892x208.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="/__u/substackcdn.com/image/fetch/$s_!7Wuz!, /__u/andrealeonel.substack.com/w_424, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F80a129d2-0590-4be5-a04c-ad1ad20a3823_892x208.png 424w, /__u/substackcdn.com/image/fetch/$s_!7Wuz!, /__u/andrealeonel.substack.com/w_848, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F80a129d2-0590-4be5-a04c-ad1ad20a3823_892x208.png 848w, /__u/substackcdn.com/image/fetch/$s_!7Wuz!, /__u/andrealeonel.substack.com/w_1272, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F80a129d2-0590-4be5-a04c-ad1ad20a3823_892x208.png 1272w, /__u/substackcdn.com/image/fetch/$s_!7Wuz!, /__u/andrealeonel.substack.com/w_1456, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F80a129d2-0590-4be5-a04c-ad1ad20a3823_892x208.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a><figcaption class="image-caption">&#8220;Where&#8221; config applied for a generic test. Source: <a href="https://docs.getdbt.com/reference/resource-configs/where">Where</a></figcaption></figure></div><p>This configuration generates a macro called <em>get_where_subquery</em> that will replace the source reference with a subquery:</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="/__u/substackcdn.com/image/fetch/$s_!M_xB!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0cc5471d-4197-46b1-93f0-4def67beaa32_931x90.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="/__u/substackcdn.com/image/fetch/$s_!M_xB!, /__u/andrealeonel.substack.com/w_424, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0cc5471d-4197-46b1-93f0-4def67beaa32_931x90.png 424w, /__u/substackcdn.com/image/fetch/$s_!M_xB!, /__u/andrealeonel.substack.com/w_848, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0cc5471d-4197-46b1-93f0-4def67beaa32_931x90.png 848w, /__u/substackcdn.com/image/fetch/$s_!M_xB!, /__u/andrealeonel.substack.com/w_1272, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0cc5471d-4197-46b1-93f0-4def67beaa32_931x90.png 1272w, /__u/substackcdn.com/image/fetch/$s_!M_xB!, /__u/andrealeonel.substack.com/w_1456, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0cc5471d-4197-46b1-93f0-4def67beaa32_931x90.png 1456w" sizes="100vw"><img src="/__u/substackcdn.com/image/fetch/$s_!M_xB!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0cc5471d-4197-46b1-93f0-4def67beaa32_931x90.png" width="931" height="90" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/0cc5471d-4197-46b1-93f0-4def67beaa32_931x90.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:90,&quot;width&quot;:931,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:10481,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://andrealeonel.substack.com/i/190379410?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0cc5471d-4197-46b1-93f0-4def67beaa32_931x90.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="/__u/substackcdn.com/image/fetch/$s_!M_xB!, /__u/andrealeonel.substack.com/w_424, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0cc5471d-4197-46b1-93f0-4def67beaa32_931x90.png 424w, /__u/substackcdn.com/image/fetch/$s_!M_xB!, /__u/andrealeonel.substack.com/w_848, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0cc5471d-4197-46b1-93f0-4def67beaa32_931x90.png 848w, /__u/substackcdn.com/image/fetch/$s_!M_xB!, /__u/andrealeonel.substack.com/w_1272, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0cc5471d-4197-46b1-93f0-4def67beaa32_931x90.png 1272w, /__u/substackcdn.com/image/fetch/$s_!M_xB!, /__u/andrealeonel.substack.com/w_1456, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0cc5471d-4197-46b1-93f0-4def67beaa32_931x90.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a><figcaption class="image-caption">Testing only records for the current date. Source: <a href="https://docs.getdbt.com/reference/resource-configs/where">Where</a></figcaption></figure></div><p>For this config, you have access to {{ var( ) }} and {{ env_var( ) }} but not custom macros. This is because configs are evaluated before custom macros are compiled.</p><p>To use custom macros in the <em>where: </em>config, you can override the default <em>get_where_subquery</em>. </p><p>For instance, say you want to test only the latest partition:</p><p>Create the custom macro <em>latest_partition.sql</em> that identifies records of the latest partition:</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="/__u/substackcdn.com/image/fetch/$s_!oGqv!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2a79427f-6a14-4279-9cbd-76817140feba_703x199.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="/__u/substackcdn.com/image/fetch/$s_!oGqv!, /__u/andrealeonel.substack.com/w_424, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2a79427f-6a14-4279-9cbd-76817140feba_703x199.png 424w, /__u/substackcdn.com/image/fetch/$s_!oGqv!, /__u/andrealeonel.substack.com/w_848, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2a79427f-6a14-4279-9cbd-76817140feba_703x199.png 848w, /__u/substackcdn.com/image/fetch/$s_!oGqv!, /__u/andrealeonel.substack.com/w_1272, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2a79427f-6a14-4279-9cbd-76817140feba_703x199.png 1272w, /__u/substackcdn.com/image/fetch/$s_!oGqv!, /__u/andrealeonel.substack.com/w_1456, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2a79427f-6a14-4279-9cbd-76817140feba_703x199.png 1456w" sizes="100vw"><img src="/__u/substackcdn.com/image/fetch/$s_!oGqv!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2a79427f-6a14-4279-9cbd-76817140feba_703x199.png" width="703" height="199" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/2a79427f-6a14-4279-9cbd-76817140feba_703x199.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:199,&quot;width&quot;:703,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:10164,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://andrealeonel.substack.com/i/190379410?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2a79427f-6a14-4279-9cbd-76817140feba_703x199.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="/__u/substackcdn.com/image/fetch/$s_!oGqv!, /__u/andrealeonel.substack.com/w_424, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2a79427f-6a14-4279-9cbd-76817140feba_703x199.png 424w, /__u/substackcdn.com/image/fetch/$s_!oGqv!, /__u/andrealeonel.substack.com/w_848, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2a79427f-6a14-4279-9cbd-76817140feba_703x199.png 848w, /__u/substackcdn.com/image/fetch/$s_!oGqv!, /__u/andrealeonel.substack.com/w_1272, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2a79427f-6a14-4279-9cbd-76817140feba_703x199.png 1272w, /__u/substackcdn.com/image/fetch/$s_!oGqv!, /__u/andrealeonel.substack.com/w_1456, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2a79427f-6a14-4279-9cbd-76817140feba_703x199.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a><figcaption class="image-caption">Source: ChatGPT</figcaption></figure></div><p>Now, create a macro named <em>get_where_subquery to</em> override the default macro and call the custom macro you just created. Don&#8217;t forget to specify the test name this should refer to if you don&#8217;t want the <em>get_where_subquery </em>to be modified for all tests.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="/__u/substackcdn.com/image/fetch/$s_!gqLV!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8d4ea893-f1b2-4b9e-a07a-94c07d507778_667x700.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="/__u/substackcdn.com/image/fetch/$s_!gqLV!, /__u/andrealeonel.substack.com/w_424, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8d4ea893-f1b2-4b9e-a07a-94c07d507778_667x700.png 424w, /__u/substackcdn.com/image/fetch/$s_!gqLV!, /__u/andrealeonel.substack.com/w_848, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8d4ea893-f1b2-4b9e-a07a-94c07d507778_667x700.png 848w, /__u/substackcdn.com/image/fetch/$s_!gqLV!, /__u/andrealeonel.substack.com/w_1272, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8d4ea893-f1b2-4b9e-a07a-94c07d507778_667x700.png 1272w, /__u/substackcdn.com/image/fetch/$s_!gqLV!, /__u/andrealeonel.substack.com/w_1456, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8d4ea893-f1b2-4b9e-a07a-94c07d507778_667x700.png 1456w" sizes="100vw"><img src="/__u/substackcdn.com/image/fetch/$s_!gqLV!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8d4ea893-f1b2-4b9e-a07a-94c07d507778_667x700.png" width="667" height="700" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/8d4ea893-f1b2-4b9e-a07a-94c07d507778_667x700.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:700,&quot;width&quot;:667,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:30559,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://andrealeonel.substack.com/i/190379410?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8d4ea893-f1b2-4b9e-a07a-94c07d507778_667x700.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="/__u/substackcdn.com/image/fetch/$s_!gqLV!, /__u/andrealeonel.substack.com/w_424, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8d4ea893-f1b2-4b9e-a07a-94c07d507778_667x700.png 424w, /__u/substackcdn.com/image/fetch/$s_!gqLV!, /__u/andrealeonel.substack.com/w_848, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8d4ea893-f1b2-4b9e-a07a-94c07d507778_667x700.png 848w, /__u/substackcdn.com/image/fetch/$s_!gqLV!, /__u/andrealeonel.substack.com/w_1272, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8d4ea893-f1b2-4b9e-a07a-94c07d507778_667x700.png 1272w, /__u/substackcdn.com/image/fetch/$s_!gqLV!, /__u/andrealeonel.substack.com/w_1456, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8d4ea893-f1b2-4b9e-a07a-94c07d507778_667x700.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption">Source: ChatGPT</figcaption></figure></div><div><hr></div><h3>General configurations</h3><ul><li><p>enabled: if set to False, dbt does not consider this resource part of the project.</p></li><li><p>tags: add common tags to resources to apply commands to all in one go using the &#8220;tag:&#8221; method.</p></li><li><p>meta: adds custom metadata for the resource to the manifest.json file and documentation.</p></li><li><p>database, schema, alias: relevant for store_failures only to set a custom path for failed records.</p></li></ul><p></p><p></p>]]></content:encoded></item><item><title><![CDATA[Data Test Properties]]></title><description><![CDATA[Setting up tests with Properties and the adjusting naming conventions for logs, artifacts and database objects.]]></description><link>https://andrealeonel.substack.com/p/data-test-properties</link><guid isPermaLink="false">https://andrealeonel.substack.com/p/data-test-properties</guid><pubDate>Fri, 23 Jan 2026 23:48:20 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!uGOk!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F83f76bad-a76c-4ffe-b843-634ce359ced4_898x481.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p><em>Part of the <a href="/__u/andrealeonel.substack.com/p/study-for-the-dbt-analytics-engineering">&#8220;Mastering dbt&#8221;</a> series. Access to the full <a href="/__u/andrealeonel.substack.com/p/dbt-analytics-engineering-certification">Study Guide</a>. Let&#8217;s connect on <a href="https://www.linkedin.com/in/andrealeonel/">LinkedIn</a>!<br>Notes from the <a href="https://docs.getdbt.com/reference/resource-properties/data-tests">About data tests property </a>documentation.</em></p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://andrealeonel.substack.com/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption">Join hundreds of aspiring dbt developers &amp; data analysts!</p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div><p>We&#8217;ve learned <a href="/__u/andrealeonel.substack.com/p/adding-data-tests-to-your-dag">what data tests are and how to implement them logically in your DAG</a>. Now, we are going to understand how to declare the properties for data tests. </p><p>These properties allow you to correctly set up your tests and apply them to multiple columns.</p><p>dbt also offers some options in terms of naming these tests, which can make logs, artifacts, and database table names more logical.</p><div><hr></div><h3>Description</h3><p>Use the data_tests property to define assertions about a column, table, or view. It can be used to define generic data tests, including the 4 built-in tests.</p><p>It can also be optionally used for singular data tests for documentation purposes using the &#8220;description&#8221; parameter.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="/__u/substackcdn.com/image/fetch/$s_!uGOk!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F83f76bad-a76c-4ffe-b843-634ce359ced4_898x481.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="/__u/substackcdn.com/image/fetch/$s_!uGOk!, /__u/andrealeonel.substack.com/w_424, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F83f76bad-a76c-4ffe-b843-634ce359ced4_898x481.png 424w, /__u/substackcdn.com/image/fetch/$s_!uGOk!, /__u/andrealeonel.substack.com/w_848, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F83f76bad-a76c-4ffe-b843-634ce359ced4_898x481.png 848w, /__u/substackcdn.com/image/fetch/$s_!uGOk!, /__u/andrealeonel.substack.com/w_1272, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F83f76bad-a76c-4ffe-b843-634ce359ced4_898x481.png 1272w, /__u/substackcdn.com/image/fetch/$s_!uGOk!, /__u/andrealeonel.substack.com/w_1456, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F83f76bad-a76c-4ffe-b843-634ce359ced4_898x481.png 1456w" sizes="100vw"><img src="/__u/substackcdn.com/image/fetch/$s_!uGOk!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F83f76bad-a76c-4ffe-b843-634ce359ced4_898x481.png" width="898" height="481" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/83f76bad-a76c-4ffe-b843-634ce359ced4_898x481.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:481,&quot;width&quot;:898,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:48498,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://andrealeonel.substack.com/i/185587693?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F83f76bad-a76c-4ffe-b843-634ce359ced4_898x481.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="/__u/substackcdn.com/image/fetch/$s_!uGOk!, /__u/andrealeonel.substack.com/w_424, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F83f76bad-a76c-4ffe-b843-634ce359ced4_898x481.png 424w, /__u/substackcdn.com/image/fetch/$s_!uGOk!, /__u/andrealeonel.substack.com/w_848, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F83f76bad-a76c-4ffe-b843-634ce359ced4_898x481.png 848w, /__u/substackcdn.com/image/fetch/$s_!uGOk!, /__u/andrealeonel.substack.com/w_1272, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F83f76bad-a76c-4ffe-b843-634ce359ced4_898x481.png 1272w, /__u/substackcdn.com/image/fetch/$s_!uGOk!, /__u/andrealeonel.substack.com/w_1456, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F83f76bad-a76c-4ffe-b843-634ce359ced4_898x481.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption">Syntax for the data_tests property (<a href="https://docs.getdbt.com/reference/resource-properties/data-tests">Source</a>).</figcaption></figure></div><div><hr></div><h3>Test-specific properties</h3><p>Out-of-the-box generic tests require specific arguments for the column it&#8217;s being applied to. It&#8217;s also possible to test using expressions involving multiple columns. </p><h4>Built-in generic tests:</h4><p>These tests have to be applied at column level.</p><p><strong>Not_null</strong></p><p>This test only requires the data_tests property to declare the test and no further arguments are needed.</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="/__u/substackcdn.com/image/fetch/$s_!oXP2!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0e2c0250-3e13-4a7e-bf93-7544f7300926_936x216.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="/__u/substackcdn.com/image/fetch/$s_!oXP2!, /__u/andrealeonel.substack.com/w_424, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0e2c0250-3e13-4a7e-bf93-7544f7300926_936x216.png 424w, /__u/substackcdn.com/image/fetch/$s_!oXP2!, /__u/andrealeonel.substack.com/w_848, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0e2c0250-3e13-4a7e-bf93-7544f7300926_936x216.png 848w, /__u/substackcdn.com/image/fetch/$s_!oXP2!, /__u/andrealeonel.substack.com/w_1272, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0e2c0250-3e13-4a7e-bf93-7544f7300926_936x216.png 1272w, /__u/substackcdn.com/image/fetch/$s_!oXP2!, /__u/andrealeonel.substack.com/w_1456, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0e2c0250-3e13-4a7e-bf93-7544f7300926_936x216.png 1456w" sizes="100vw"><img src="/__u/substackcdn.com/image/fetch/$s_!oXP2!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0e2c0250-3e13-4a7e-bf93-7544f7300926_936x216.png" width="936" height="216" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/0e2c0250-3e13-4a7e-bf93-7544f7300926_936x216.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:216,&quot;width&quot;:936,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:11054,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://andrealeonel.substack.com/i/185587693?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0e2c0250-3e13-4a7e-bf93-7544f7300926_936x216.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="/__u/substackcdn.com/image/fetch/$s_!oXP2!, /__u/andrealeonel.substack.com/w_424, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0e2c0250-3e13-4a7e-bf93-7544f7300926_936x216.png 424w, /__u/substackcdn.com/image/fetch/$s_!oXP2!, /__u/andrealeonel.substack.com/w_848, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0e2c0250-3e13-4a7e-bf93-7544f7300926_936x216.png 848w, /__u/substackcdn.com/image/fetch/$s_!oXP2!, /__u/andrealeonel.substack.com/w_1272, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0e2c0250-3e13-4a7e-bf93-7544f7300926_936x216.png 1272w, /__u/substackcdn.com/image/fetch/$s_!oXP2!, /__u/andrealeonel.substack.com/w_1456, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0e2c0250-3e13-4a7e-bf93-7544f7300926_936x216.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a><figcaption class="image-caption">Declaring not_null tests. <a href="https://docs.getdbt.com/reference/resource-properties/data-tests">Source</a>.</figcaption></figure></div><p><strong>Unique</strong></p><p>Similar to not_null, unique only has to be declared. However, it takes an optional &#8220;where&#8221; config to filter the rows this is applied to.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="/__u/substackcdn.com/image/fetch/$s_!xO5k!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6c437797-8b9a-406d-8f4b-018d0835eb07_931x252.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="/__u/substackcdn.com/image/fetch/$s_!xO5k!, /__u/andrealeonel.substack.com/w_424, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6c437797-8b9a-406d-8f4b-018d0835eb07_931x252.png 424w, /__u/substackcdn.com/image/fetch/$s_!xO5k!, /__u/andrealeonel.substack.com/w_848, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6c437797-8b9a-406d-8f4b-018d0835eb07_931x252.png 848w, /__u/substackcdn.com/image/fetch/$s_!xO5k!, /__u/andrealeonel.substack.com/w_1272, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6c437797-8b9a-406d-8f4b-018d0835eb07_931x252.png 1272w, /__u/substackcdn.com/image/fetch/$s_!xO5k!, /__u/andrealeonel.substack.com/w_1456, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6c437797-8b9a-406d-8f4b-018d0835eb07_931x252.png 1456w" sizes="100vw"><img src="/__u/substackcdn.com/image/fetch/$s_!xO5k!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6c437797-8b9a-406d-8f4b-018d0835eb07_931x252.png" width="931" height="252" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/6c437797-8b9a-406d-8f4b-018d0835eb07_931x252.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:252,&quot;width&quot;:931,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:14411,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://andrealeonel.substack.com/i/185587693?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6c437797-8b9a-406d-8f4b-018d0835eb07_931x252.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="/__u/substackcdn.com/image/fetch/$s_!xO5k!, /__u/andrealeonel.substack.com/w_424, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6c437797-8b9a-406d-8f4b-018d0835eb07_931x252.png 424w, /__u/substackcdn.com/image/fetch/$s_!xO5k!, /__u/andrealeonel.substack.com/w_848, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6c437797-8b9a-406d-8f4b-018d0835eb07_931x252.png 848w, /__u/substackcdn.com/image/fetch/$s_!xO5k!, /__u/andrealeonel.substack.com/w_1272, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6c437797-8b9a-406d-8f4b-018d0835eb07_931x252.png 1272w, /__u/substackcdn.com/image/fetch/$s_!xO5k!, /__u/andrealeonel.substack.com/w_1456, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6c437797-8b9a-406d-8f4b-018d0835eb07_931x252.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption">The config &#8220;where&#8221; can be used to filter rows for this test. <a href="https://docs.getdbt.com/reference/resource-properties/data-tests">Source</a></figcaption></figure></div><p><strong>Accepted_values</strong></p><p>This test requires no further configuration for strings. However, if you want your accepted values to be non-string values (like integers or booleans), you need an additional &#8220;quote&#8221; argument to be set to false.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="/__u/substackcdn.com/image/fetch/$s_!q1ZP!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd78a2dbf-201b-4260-80b5-ee43dc8506ec_934x414.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="/__u/substackcdn.com/image/fetch/$s_!q1ZP!, /__u/andrealeonel.substack.com/w_424, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd78a2dbf-201b-4260-80b5-ee43dc8506ec_934x414.png 424w, /__u/substackcdn.com/image/fetch/$s_!q1ZP!, /__u/andrealeonel.substack.com/w_848, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd78a2dbf-201b-4260-80b5-ee43dc8506ec_934x414.png 848w, /__u/substackcdn.com/image/fetch/$s_!q1ZP!, /__u/andrealeonel.substack.com/w_1272, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd78a2dbf-201b-4260-80b5-ee43dc8506ec_934x414.png 1272w, /__u/substackcdn.com/image/fetch/$s_!q1ZP!, /__u/andrealeonel.substack.com/w_1456, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd78a2dbf-201b-4260-80b5-ee43dc8506ec_934x414.png 1456w" sizes="100vw"><img src="/__u/substackcdn.com/image/fetch/$s_!q1ZP!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd78a2dbf-201b-4260-80b5-ee43dc8506ec_934x414.png" width="934" height="414" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/d78a2dbf-201b-4260-80b5-ee43dc8506ec_934x414.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:414,&quot;width&quot;:934,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:38855,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://andrealeonel.substack.com/i/185587693?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd78a2dbf-201b-4260-80b5-ee43dc8506ec_934x414.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="/__u/substackcdn.com/image/fetch/$s_!q1ZP!, /__u/andrealeonel.substack.com/w_424, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd78a2dbf-201b-4260-80b5-ee43dc8506ec_934x414.png 424w, /__u/substackcdn.com/image/fetch/$s_!q1ZP!, /__u/andrealeonel.substack.com/w_848, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd78a2dbf-201b-4260-80b5-ee43dc8506ec_934x414.png 848w, /__u/substackcdn.com/image/fetch/$s_!q1ZP!, /__u/andrealeonel.substack.com/w_1272, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd78a2dbf-201b-4260-80b5-ee43dc8506ec_934x414.png 1272w, /__u/substackcdn.com/image/fetch/$s_!q1ZP!, /__u/andrealeonel.substack.com/w_1456, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd78a2dbf-201b-4260-80b5-ee43dc8506ec_934x414.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption">Examples of string and non-string values within the accepted_values test. <a href="https://docs.getdbt.com/reference/resource-properties/data-tests">Source</a></figcaption></figure></div><p><strong>Relationships</strong></p><p>This test takes an argument &#8220;to&#8221; and a &#8220;field&#8221; that define which child table it should look for corresponding values from the parent table.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="/__u/substackcdn.com/image/fetch/$s_!-umw!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9908dd9a-739d-4848-aaed-e4026d1250f3_934x289.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="/__u/substackcdn.com/image/fetch/$s_!-umw!, /__u/andrealeonel.substack.com/w_424, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9908dd9a-739d-4848-aaed-e4026d1250f3_934x289.png 424w, /__u/substackcdn.com/image/fetch/$s_!-umw!, /__u/andrealeonel.substack.com/w_848, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9908dd9a-739d-4848-aaed-e4026d1250f3_934x289.png 848w, /__u/substackcdn.com/image/fetch/$s_!-umw!, /__u/andrealeonel.substack.com/w_1272, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9908dd9a-739d-4848-aaed-e4026d1250f3_934x289.png 1272w, /__u/substackcdn.com/image/fetch/$s_!-umw!, /__u/andrealeonel.substack.com/w_1456, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9908dd9a-739d-4848-aaed-e4026d1250f3_934x289.png 1456w" sizes="100vw"><img src="/__u/substackcdn.com/image/fetch/$s_!-umw!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9908dd9a-739d-4848-aaed-e4026d1250f3_934x289.png" width="934" height="289" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/9908dd9a-739d-4848-aaed-e4026d1250f3_934x289.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:289,&quot;width&quot;:934,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:26613,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://andrealeonel.substack.com/i/185587693?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9908dd9a-739d-4848-aaed-e4026d1250f3_934x289.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="/__u/substackcdn.com/image/fetch/$s_!-umw!, /__u/andrealeonel.substack.com/w_424, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9908dd9a-739d-4848-aaed-e4026d1250f3_934x289.png 424w, /__u/substackcdn.com/image/fetch/$s_!-umw!, /__u/andrealeonel.substack.com/w_848, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9908dd9a-739d-4848-aaed-e4026d1250f3_934x289.png 848w, /__u/substackcdn.com/image/fetch/$s_!-umw!, /__u/andrealeonel.substack.com/w_1272, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9908dd9a-739d-4848-aaed-e4026d1250f3_934x289.png 1272w, /__u/substackcdn.com/image/fetch/$s_!-umw!, /__u/andrealeonel.substack.com/w_1456, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9908dd9a-739d-4848-aaed-e4026d1250f3_934x289.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption">Setting up the relationships test. <a href="https://docs.getdbt.com/reference/resource-properties/data-tests">Source</a></figcaption></figure></div><p>Please note that this test excludes null values from validation. If you want nulls to cause failures, use the not_null test.</p><h4>Testing an expression:</h4><p>When a data test involves multiple columns, it doesn&#8217;t make sense to place it under the &#8220;columns&#8221; key. In these cases, you apply the test to the model.</p><p>For instance, when using the dbt_utils.expression_is_true:</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="/__u/substackcdn.com/image/fetch/$s_!9yrP!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd3bde177-476f-4d6b-b86e-a5f444514f03_931x354.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="/__u/substackcdn.com/image/fetch/$s_!9yrP!, /__u/andrealeonel.substack.com/w_424, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd3bde177-476f-4d6b-b86e-a5f444514f03_931x354.png 424w, /__u/substackcdn.com/image/fetch/$s_!9yrP!, /__u/andrealeonel.substack.com/w_848, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd3bde177-476f-4d6b-b86e-a5f444514f03_931x354.png 848w, /__u/substackcdn.com/image/fetch/$s_!9yrP!, /__u/andrealeonel.substack.com/w_1272, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd3bde177-476f-4d6b-b86e-a5f444514f03_931x354.png 1272w, /__u/substackcdn.com/image/fetch/$s_!9yrP!, /__u/andrealeonel.substack.com/w_1456, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd3bde177-476f-4d6b-b86e-a5f444514f03_931x354.png 1456w" sizes="100vw"><img src="/__u/substackcdn.com/image/fetch/$s_!9yrP!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd3bde177-476f-4d6b-b86e-a5f444514f03_931x354.png" width="931" height="354" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/d3bde177-476f-4d6b-b86e-a5f444514f03_931x354.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:354,&quot;width&quot;:931,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:48465,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://andrealeonel.substack.com/i/185587693?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd3bde177-476f-4d6b-b86e-a5f444514f03_931x354.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="/__u/substackcdn.com/image/fetch/$s_!9yrP!, /__u/andrealeonel.substack.com/w_424, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd3bde177-476f-4d6b-b86e-a5f444514f03_931x354.png 424w, /__u/substackcdn.com/image/fetch/$s_!9yrP!, /__u/andrealeonel.substack.com/w_848, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd3bde177-476f-4d6b-b86e-a5f444514f03_931x354.png 848w, /__u/substackcdn.com/image/fetch/$s_!9yrP!, /__u/andrealeonel.substack.com/w_1272, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd3bde177-476f-4d6b-b86e-a5f444514f03_931x354.png 1272w, /__u/substackcdn.com/image/fetch/$s_!9yrP!, /__u/andrealeonel.substack.com/w_1456, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd3bde177-476f-4d6b-b86e-a5f444514f03_931x354.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption">Data test applied to the model and using an &#8220;expression&#8221; argument. <a href="https://docs.getdbt.com/reference/resource-properties/data-tests">Source</a></figcaption></figure></div><div><hr></div><h3>Custom test names: the &#8220;name&#8221; property</h3><p>dbt will define the test names in the artifacts by concatenating the test name, the resource name and, if relevant, column name and arguments.</p><p>You may want to define a custom name for your tests to obtain a more recognisable name in the artifacts. For that, you can use the &#8220;name&#8221; property. </p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="/__u/substackcdn.com/image/fetch/$s_!sl_W!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2ef0137f-2f91-4b8f-b757-cc2d17ffb7c4_931x334.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="/__u/substackcdn.com/image/fetch/$s_!sl_W!, /__u/andrealeonel.substack.com/w_424, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2ef0137f-2f91-4b8f-b757-cc2d17ffb7c4_931x334.png 424w, /__u/substackcdn.com/image/fetch/$s_!sl_W!, /__u/andrealeonel.substack.com/w_848, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2ef0137f-2f91-4b8f-b757-cc2d17ffb7c4_931x334.png 848w, /__u/substackcdn.com/image/fetch/$s_!sl_W!, /__u/andrealeonel.substack.com/w_1272, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2ef0137f-2f91-4b8f-b757-cc2d17ffb7c4_931x334.png 1272w, /__u/substackcdn.com/image/fetch/$s_!sl_W!, /__u/andrealeonel.substack.com/w_1456, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2ef0137f-2f91-4b8f-b757-cc2d17ffb7c4_931x334.png 1456w" sizes="100vw"><img src="/__u/substackcdn.com/image/fetch/$s_!sl_W!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2ef0137f-2f91-4b8f-b757-cc2d17ffb7c4_931x334.png" width="931" height="334" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/2ef0137f-2f91-4b8f-b757-cc2d17ffb7c4_931x334.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:334,&quot;width&quot;:931,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:36910,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://andrealeonel.substack.com/i/185587693?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2ef0137f-2f91-4b8f-b757-cc2d17ffb7c4_931x334.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="/__u/substackcdn.com/image/fetch/$s_!sl_W!, /__u/andrealeonel.substack.com/w_424, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2ef0137f-2f91-4b8f-b757-cc2d17ffb7c4_931x334.png 424w, /__u/substackcdn.com/image/fetch/$s_!sl_W!, /__u/andrealeonel.substack.com/w_848, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2ef0137f-2f91-4b8f-b757-cc2d17ffb7c4_931x334.png 848w, /__u/substackcdn.com/image/fetch/$s_!sl_W!, /__u/andrealeonel.substack.com/w_1272, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2ef0137f-2f91-4b8f-b757-cc2d17ffb7c4_931x334.png 1272w, /__u/substackcdn.com/image/fetch/$s_!sl_W!, /__u/andrealeonel.substack.com/w_1456, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2ef0137f-2f91-4b8f-b757-cc2d17ffb7c4_931x334.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption">Applying the alias &#8220;unexpected_order_status_today&#8221; to a data test. <a href="https://docs.getdbt.com/reference/resource-properties/data-tests">Source</a></figcaption></figure></div><p>Besides showing in artifacts and logs, this custom name can be used by the &#8220;select&#8221; method to run only a specific data test. </p><p>You cannot have duplicate custom names for the same column. However, you can repeat them across different columns or models. In this case, the &#8220;select&#8221; method will run all tests under the same custom name.</p><p>You can also use custom names when you need to apply the same data test type to one column. By giving them custom names, dbt will know how to differentiate them.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="/__u/substackcdn.com/image/fetch/$s_!8gU0!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F82235f03-0ea4-444e-a854-dc2a38a0edcb_937x462.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="/__u/substackcdn.com/image/fetch/$s_!8gU0!, /__u/andrealeonel.substack.com/w_424, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F82235f03-0ea4-444e-a854-dc2a38a0edcb_937x462.png 424w, /__u/substackcdn.com/image/fetch/$s_!8gU0!, /__u/andrealeonel.substack.com/w_848, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F82235f03-0ea4-444e-a854-dc2a38a0edcb_937x462.png 848w, /__u/substackcdn.com/image/fetch/$s_!8gU0!, /__u/andrealeonel.substack.com/w_1272, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F82235f03-0ea4-444e-a854-dc2a38a0edcb_937x462.png 1272w, /__u/substackcdn.com/image/fetch/$s_!8gU0!, /__u/andrealeonel.substack.com/w_1456, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F82235f03-0ea4-444e-a854-dc2a38a0edcb_937x462.png 1456w" sizes="100vw"><img src="/__u/substackcdn.com/image/fetch/$s_!8gU0!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F82235f03-0ea4-444e-a854-dc2a38a0edcb_937x462.png" width="937" height="462" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/82235f03-0ea4-444e-a854-dc2a38a0edcb_937x462.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:462,&quot;width&quot;:937,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:56738,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://andrealeonel.substack.com/i/185587693?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F82235f03-0ea4-444e-a854-dc2a38a0edcb_937x462.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="/__u/substackcdn.com/image/fetch/$s_!8gU0!, /__u/andrealeonel.substack.com/w_424, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F82235f03-0ea4-444e-a854-dc2a38a0edcb_937x462.png 424w, /__u/substackcdn.com/image/fetch/$s_!8gU0!, /__u/andrealeonel.substack.com/w_848, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F82235f03-0ea4-444e-a854-dc2a38a0edcb_937x462.png 848w, /__u/substackcdn.com/image/fetch/$s_!8gU0!, /__u/andrealeonel.substack.com/w_1272, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F82235f03-0ea4-444e-a854-dc2a38a0edcb_937x462.png 1272w, /__u/substackcdn.com/image/fetch/$s_!8gU0!, /__u/andrealeonel.substack.com/w_1456, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F82235f03-0ea4-444e-a854-dc2a38a0edcb_937x462.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption">Two accepted_values tests applied to a single column, but testing different sets of rows. Custom names help dbt to differentiate them. <a href="https://docs.getdbt.com/reference/resource-properties/data-tests">Source</a></figcaption></figure></div><h4>Alias for &#8220;store_failures&#8221; database table</h4><p>When switching &#8220;store_failures&#8221; on, dbt will store test results in a database object. By default, it takes the name of the test, or the custom name if defined, as the name of the database table.</p><p>If you&#8217;d like the database table to have a different name, you can set an alias for the test.</p><div><hr></div><h3>Using &#8220;test_name&#8221; to flatten config</h3><p>dbt offers the option to define test properties using the &#8220;test_name&#8221; property to make your file easier to read. The result is the same.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="/__u/substackcdn.com/image/fetch/$s_!ctvl!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fab7c18ed-cbb1-4c2e-9bc8-3c30e08fabb7_939x417.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="/__u/substackcdn.com/image/fetch/$s_!ctvl!, /__u/andrealeonel.substack.com/w_424, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fab7c18ed-cbb1-4c2e-9bc8-3c30e08fabb7_939x417.png 424w, /__u/substackcdn.com/image/fetch/$s_!ctvl!, /__u/andrealeonel.substack.com/w_848, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fab7c18ed-cbb1-4c2e-9bc8-3c30e08fabb7_939x417.png 848w, /__u/substackcdn.com/image/fetch/$s_!ctvl!, /__u/andrealeonel.substack.com/w_1272, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fab7c18ed-cbb1-4c2e-9bc8-3c30e08fabb7_939x417.png 1272w, /__u/substackcdn.com/image/fetch/$s_!ctvl!, /__u/andrealeonel.substack.com/w_1456, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fab7c18ed-cbb1-4c2e-9bc8-3c30e08fabb7_939x417.png 1456w" sizes="100vw"><img src="/__u/substackcdn.com/image/fetch/$s_!ctvl!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fab7c18ed-cbb1-4c2e-9bc8-3c30e08fabb7_939x417.png" width="939" height="417" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/ab7c18ed-cbb1-4c2e-9bc8-3c30e08fabb7_939x417.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:417,&quot;width&quot;:939,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:43891,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://andrealeonel.substack.com/i/185587693?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fab7c18ed-cbb1-4c2e-9bc8-3c30e08fabb7_939x417.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="/__u/substackcdn.com/image/fetch/$s_!ctvl!, /__u/andrealeonel.substack.com/w_424, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fab7c18ed-cbb1-4c2e-9bc8-3c30e08fabb7_939x417.png 424w, /__u/substackcdn.com/image/fetch/$s_!ctvl!, /__u/andrealeonel.substack.com/w_848, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fab7c18ed-cbb1-4c2e-9bc8-3c30e08fabb7_939x417.png 848w, /__u/substackcdn.com/image/fetch/$s_!ctvl!, /__u/andrealeonel.substack.com/w_1272, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fab7c18ed-cbb1-4c2e-9bc8-3c30e08fabb7_939x417.png 1272w, /__u/substackcdn.com/image/fetch/$s_!ctvl!, /__u/andrealeonel.substack.com/w_1456, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fab7c18ed-cbb1-4c2e-9bc8-3c30e08fabb7_939x417.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption">Using test_name instead of the -accepted_values to make the file more streamlined. <a href="https://docs.getdbt.com/reference/resource-properties/data-tests">Source</a></figcaption></figure></div>]]></content:encoded></item><item><title><![CDATA[Adding data tests to your DAG]]></title><description><![CDATA[Why you should test your data and how to implement data testing in a healthy way to your DAG]]></description><link>https://andrealeonel.substack.com/p/adding-data-tests-to-your-dag</link><guid isPermaLink="false">https://andrealeonel.substack.com/p/adding-data-tests-to-your-dag</guid><pubDate>Sat, 17 Jan 2026 00:11:15 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!f2xS!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa9ff8f10-02f7-42a6-80e4-92fbda78e854_1008x664.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p><em>Part of the <a href="/__u/andrealeonel.substack.com/p/study-for-the-dbt-analytics-engineering">&#8220;Mastering dbt&#8221;</a> series. Access to the full <a href="/__u/andrealeonel.substack.com/p/dbt-analytics-engineering-certification">Study Guide</a>. Let&#8217;s connect on <a href="https://www.linkedin.com/in/andrealeonel/">LinkedIn</a>!<br>Notes from the <a href="https://www.getdbt.com/blog/data-testing">Why is data testing necessary?</a> and <a href="https://docs.getdbt.com/docs/build/data-tests">Add data tests to your DAG</a> documentation</em></p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://andrealeonel.substack.com/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption">Join hundreds of aspiring dbt developers &amp; data analysts!</p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div><p>Data tests are assumptions we make about resources in our project. For instance, we can configure a model to fail or issue a warning when certain preset requirements are not met. </p><p>dbt offers a few out-of-the-box solutions, but it is also possible to create custom tests to reflect specific business logic. </p><p>In this post, we will cover the reasons why you should add tests to your project and suggest a gradual implementation of data testing. Finally, we&#8217;ll go into the nitty-gritty of adding data tests to your DAG.</p><p>In the next posts, we will cover data test properties, configurations, and the dbt test command.</p><div><hr></div><h3>The importance of data testing</h3><p>Whether you deal with internal or external stakeholders, trust in the data is fundamental to getting buy-in and support. Therefore, data professionals cannot afford the risk of sharing incorrect data.</p><p>When we are engineering a complex project, we could end up running countless models successfully without ever noticing that something is off.</p><p>Data testing helps us ensure that certain assumptions are met before models are built successfully - or at least throw a warning for less critical issues.</p><p>The built-in data testing tools in dbt enable you to check if:</p><ul><li><p>The SQL code is doing what it&#8217;s meant to do</p></li><li><p>Assumptions about your source data are correct</p></li><li><p>Anything changed in your source data that is impacting your assumptions</p></li></ul><h3>Introducing data tests gradually and sustainably</h3><p>You don&#8217;t need to set up every data test under the sun just because they are available. dbt&#8217;s general rule of thumb goes for data testing too: don&#8217;t make your project unnecessarily complex.</p><p>dbt suggests the gradual introduction of tests following the phases below:</p><h4>1) Simple test use cases</h4><p>Initially, you might not be testing your data.</p><p>However, if you&#8217;re consistently running into data quality issues or you&#8217;re preparing to enhance your project&#8217;s complexity, it&#8217;s time to consider adding tests.</p><ul><li><p><strong>Primary Keys: </strong>Unique &amp; not_null tests help you identify values that mess with filters, joins, or aggregate calculations.</p></li><li><p><strong>Accepted values or relationship tests: </strong>for columns with predictable values, this test flags any new values that appear in the source data.</p></li></ul><h4>2) Preempting issues</h4><p>As your project grows, you might want to start preparing for outliers or lack of freshness.</p><p>Here you can go beyond dbt&#8217;s out-of-the-box tests and into custom testing to spot and treat these corner cases in your data.</p><p>You can also consider configuring freshness so dbt alerts you when a source is stale. <a href="/__u/andrealeonel.substack.com/p/setting-up-and-using-source-freshness">Source freshness was addressed in Checkpoint 2</a>.</p><h4>3) Tackle workflow testing</h4><p>Once you&#8217;ve safeguarded your project, it&#8217;s time to expand testing into the pull requests with CI/CD jobs. These will be discussed further in this Checkpoint.</p><p>dbt also recommends creating a testing culture within the team with data tests consistently being added to new code and processes in place to debug test failures. I&#8217;d also add the usage of a good PR template to ensure data quality, another aspect that will be discussed later in this Checkpoint.</p><h4>4) Avoid over-testing</h4><p>At this stage, you could potentially find yourself drowning in warnings and errors generated by data tests.</p><p>Consider removing those warnings that you are consistently ignoring so your project only flags those that really deserve your attention. A periodic audit for deprecated fields or tests can be a good tactic.</p><p>You can also evaluate switching errors to warnings if you find that your project is delayed over failures that are not that severe.</p><p>Finally, consider the value for money of your tests: data testing may incur computing and development costs.</p><div><hr></div><h3>Adding tests to your DAG</h3><h4>What are data tests in dbt?</h4><p>Firstly, it&#8217;s important to understand that, like most things in dbt, data tests are SQL queries. Their statement will pull a list of records that fail the test you set up.</p><p>There are two types of data tests in dbt:</p><h4>Singular data tests</h4><p>Singular tests are a custom SQL query that returns failing rows saved in a .sql file in your test directory. These are useful to test assumptions that involve specific business logic.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="/__u/substackcdn.com/image/fetch/$s_!v8oY!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F84157012-6ba1-454c-ab20-b11a2f7b694f_1005x387.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="/__u/substackcdn.com/image/fetch/$s_!v8oY!, /__u/andrealeonel.substack.com/w_424, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F84157012-6ba1-454c-ab20-b11a2f7b694f_1005x387.png 424w, /__u/substackcdn.com/image/fetch/$s_!v8oY!, /__u/andrealeonel.substack.com/w_848, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F84157012-6ba1-454c-ab20-b11a2f7b694f_1005x387.png 848w, /__u/substackcdn.com/image/fetch/$s_!v8oY!, /__u/andrealeonel.substack.com/w_1272, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F84157012-6ba1-454c-ab20-b11a2f7b694f_1005x387.png 1272w, /__u/substackcdn.com/image/fetch/$s_!v8oY!, /__u/andrealeonel.substack.com/w_1456, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F84157012-6ba1-454c-ab20-b11a2f7b694f_1005x387.png 1456w" sizes="100vw"><img src="/__u/substackcdn.com/image/fetch/$s_!v8oY!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F84157012-6ba1-454c-ab20-b11a2f7b694f_1005x387.png" width="1005" height="387" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/84157012-6ba1-454c-ab20-b11a2f7b694f_1005x387.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:387,&quot;width&quot;:1005,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:52110,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://andrealeonel.substack.com/i/184821948?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F84157012-6ba1-454c-ab20-b11a2f7b694f_1005x387.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="/__u/substackcdn.com/image/fetch/$s_!v8oY!, /__u/andrealeonel.substack.com/w_424, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F84157012-6ba1-454c-ab20-b11a2f7b694f_1005x387.png 424w, /__u/substackcdn.com/image/fetch/$s_!v8oY!, /__u/andrealeonel.substack.com/w_848, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F84157012-6ba1-454c-ab20-b11a2f7b694f_1005x387.png 848w, /__u/substackcdn.com/image/fetch/$s_!v8oY!, /__u/andrealeonel.substack.com/w_1272, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F84157012-6ba1-454c-ab20-b11a2f7b694f_1005x387.png 1272w, /__u/substackcdn.com/image/fetch/$s_!v8oY!, /__u/andrealeonel.substack.com/w_1456, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F84157012-6ba1-454c-ab20-b11a2f7b694f_1005x387.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption"><strong>Example singular test. Source: <a href="https://docs.getdbt.com/docs/build/data-tests">Add data tests to your DAG</a></strong></figcaption></figure></div><p>The SQL query should return the list of failing records and their relevant attributes. Remember to omit semicolons at the end of the statement.</p><p>You can use Jinja in singular testing, as shown in the ref( ) function above. The name of the file becomes the test name.</p><p>Any singular tests included in the test directory will automatically be summoned by the dbt test command. </p><p>They don&#8217;t need to be referenced or configured in .yml files. However, you may want to document them under the data_test block with a description:</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="/__u/substackcdn.com/image/fetch/$s_!FX-u!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1a9432bc-dec7-49b9-b519-53644b46eec5_1005x351.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="/__u/substackcdn.com/image/fetch/$s_!FX-u!, /__u/andrealeonel.substack.com/w_424, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1a9432bc-dec7-49b9-b519-53644b46eec5_1005x351.png 424w, /__u/substackcdn.com/image/fetch/$s_!FX-u!, /__u/andrealeonel.substack.com/w_848, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1a9432bc-dec7-49b9-b519-53644b46eec5_1005x351.png 848w, /__u/substackcdn.com/image/fetch/$s_!FX-u!, /__u/andrealeonel.substack.com/w_1272, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1a9432bc-dec7-49b9-b519-53644b46eec5_1005x351.png 1272w, /__u/substackcdn.com/image/fetch/$s_!FX-u!, /__u/andrealeonel.substack.com/w_1456, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1a9432bc-dec7-49b9-b519-53644b46eec5_1005x351.png 1456w" sizes="100vw"><img src="/__u/substackcdn.com/image/fetch/$s_!FX-u!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1a9432bc-dec7-49b9-b519-53644b46eec5_1005x351.png" width="1005" height="351" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/1a9432bc-dec7-49b9-b519-53644b46eec5_1005x351.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:351,&quot;width&quot;:1005,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:36708,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://andrealeonel.substack.com/i/184821948?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1a9432bc-dec7-49b9-b519-53644b46eec5_1005x351.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="/__u/substackcdn.com/image/fetch/$s_!FX-u!, /__u/andrealeonel.substack.com/w_424, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1a9432bc-dec7-49b9-b519-53644b46eec5_1005x351.png 424w, /__u/substackcdn.com/image/fetch/$s_!FX-u!, /__u/andrealeonel.substack.com/w_848, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1a9432bc-dec7-49b9-b519-53644b46eec5_1005x351.png 848w, /__u/substackcdn.com/image/fetch/$s_!FX-u!, /__u/andrealeonel.substack.com/w_1272, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1a9432bc-dec7-49b9-b519-53644b46eec5_1005x351.png 1272w, /__u/substackcdn.com/image/fetch/$s_!FX-u!, /__u/andrealeonel.substack.com/w_1456, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1a9432bc-dec7-49b9-b519-53644b46eec5_1005x351.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption">Adding singular tests to yml files for documentation purposes. Source: <a href="https://docs.getdbt.com/docs/build/data-tests#singular-data-tests">Add data tests to your DAG</a></figcaption></figure></div><h4>Generic data tests</h4><p>These are parameterised queries defined by a test block, like a macro, that can be referenced throughout your project. dbt comes with four generic tests out of the box.</p><p>Once defined and saved in the tests directory, this test has to be defined as a property of a given resource in their respective yml file.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="/__u/substackcdn.com/image/fetch/$s_!Y7d6!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3e6d252a-9795-4ad3-b5a9-483c755e6c1a_996x259.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="/__u/substackcdn.com/image/fetch/$s_!Y7d6!, /__u/andrealeonel.substack.com/w_424, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3e6d252a-9795-4ad3-b5a9-483c755e6c1a_996x259.png 424w, /__u/substackcdn.com/image/fetch/$s_!Y7d6!, /__u/andrealeonel.substack.com/w_848, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3e6d252a-9795-4ad3-b5a9-483c755e6c1a_996x259.png 848w, /__u/substackcdn.com/image/fetch/$s_!Y7d6!, /__u/andrealeonel.substack.com/w_1272, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3e6d252a-9795-4ad3-b5a9-483c755e6c1a_996x259.png 1272w, /__u/substackcdn.com/image/fetch/$s_!Y7d6!, /__u/andrealeonel.substack.com/w_1456, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3e6d252a-9795-4ad3-b5a9-483c755e6c1a_996x259.png 1456w" sizes="100vw"><img src="/__u/substackcdn.com/image/fetch/$s_!Y7d6!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3e6d252a-9795-4ad3-b5a9-483c755e6c1a_996x259.png" width="996" height="259" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/3e6d252a-9795-4ad3-b5a9-483c755e6c1a_996x259.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:259,&quot;width&quot;:996,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:22490,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://andrealeonel.substack.com/i/184821948?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3e6d252a-9795-4ad3-b5a9-483c755e6c1a_996x259.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="/__u/substackcdn.com/image/fetch/$s_!Y7d6!, /__u/andrealeonel.substack.com/w_424, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3e6d252a-9795-4ad3-b5a9-483c755e6c1a_996x259.png 424w, /__u/substackcdn.com/image/fetch/$s_!Y7d6!, /__u/andrealeonel.substack.com/w_848, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3e6d252a-9795-4ad3-b5a9-483c755e6c1a_996x259.png 848w, /__u/substackcdn.com/image/fetch/$s_!Y7d6!, /__u/andrealeonel.substack.com/w_1272, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3e6d252a-9795-4ad3-b5a9-483c755e6c1a_996x259.png 1272w, /__u/substackcdn.com/image/fetch/$s_!Y7d6!, /__u/andrealeonel.substack.com/w_1456, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3e6d252a-9795-4ad3-b5a9-483c755e6c1a_996x259.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption">Example of generic test saved as macro that can be reused throughout the project. Source: <a href="https://docs.getdbt.com/docs/build/data-tests#generic-data-tests">Add data tests to your DAG</a></figcaption></figure></div><p>The example above is simply checking a column for nulls. However, dbt already includes this type of testing and three others as a native feature.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="/__u/substackcdn.com/image/fetch/$s_!f2xS!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa9ff8f10-02f7-42a6-80e4-92fbda78e854_1008x664.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="/__u/substackcdn.com/image/fetch/$s_!f2xS!, /__u/andrealeonel.substack.com/w_424, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa9ff8f10-02f7-42a6-80e4-92fbda78e854_1008x664.png 424w, /__u/substackcdn.com/image/fetch/$s_!f2xS!, /__u/andrealeonel.substack.com/w_848, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa9ff8f10-02f7-42a6-80e4-92fbda78e854_1008x664.png 848w, /__u/substackcdn.com/image/fetch/$s_!f2xS!, /__u/andrealeonel.substack.com/w_1272, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa9ff8f10-02f7-42a6-80e4-92fbda78e854_1008x664.png 1272w, /__u/substackcdn.com/image/fetch/$s_!f2xS!, /__u/andrealeonel.substack.com/w_1456, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa9ff8f10-02f7-42a6-80e4-92fbda78e854_1008x664.png 1456w" sizes="100vw"><img src="/__u/substackcdn.com/image/fetch/$s_!f2xS!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa9ff8f10-02f7-42a6-80e4-92fbda78e854_1008x664.png" width="1008" height="664" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/a9ff8f10-02f7-42a6-80e4-92fbda78e854_1008x664.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:664,&quot;width&quot;:1008,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:71032,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://andrealeonel.substack.com/i/184821948?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa9ff8f10-02f7-42a6-80e4-92fbda78e854_1008x664.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="/__u/substackcdn.com/image/fetch/$s_!f2xS!, /__u/andrealeonel.substack.com/w_424, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa9ff8f10-02f7-42a6-80e4-92fbda78e854_1008x664.png 424w, /__u/substackcdn.com/image/fetch/$s_!f2xS!, /__u/andrealeonel.substack.com/w_848, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa9ff8f10-02f7-42a6-80e4-92fbda78e854_1008x664.png 848w, /__u/substackcdn.com/image/fetch/$s_!f2xS!, /__u/andrealeonel.substack.com/w_1272, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa9ff8f10-02f7-42a6-80e4-92fbda78e854_1008x664.png 1272w, /__u/substackcdn.com/image/fetch/$s_!f2xS!, /__u/andrealeonel.substack.com/w_1456, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa9ff8f10-02f7-42a6-80e4-92fbda78e854_1008x664.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption">Configuration for the four out-of-the-box generic tests in dbt. Source: <a href="https://docs.getdbt.com/docs/build/data-tests#generic-data-tests">Add tests to your DAG</a></figcaption></figure></div><p>The out-of-the-box generic tests assert that: </p><ul><li><p>unique: a column (or combination of columns) contains no duplicate values.</p></li><li><p>not_null: a column contains no null values.</p></li><li><p>accepted_values: all values in a column are in a set of possible values.</p></li><li><p>relationships: each value in a given column exists in another table.</p></li></ul><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="/__u/substackcdn.com/image/fetch/$s_!Nhjz!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8818b736-6f65-4072-b5d2-7f06f2cf0b76_889x367.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="/__u/substackcdn.com/image/fetch/$s_!Nhjz!, /__u/andrealeonel.substack.com/w_424, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8818b736-6f65-4072-b5d2-7f06f2cf0b76_889x367.png 424w, /__u/substackcdn.com/image/fetch/$s_!Nhjz!, /__u/andrealeonel.substack.com/w_848, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8818b736-6f65-4072-b5d2-7f06f2cf0b76_889x367.png 848w, /__u/substackcdn.com/image/fetch/$s_!Nhjz!, /__u/andrealeonel.substack.com/w_1272, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8818b736-6f65-4072-b5d2-7f06f2cf0b76_889x367.png 1272w, /__u/substackcdn.com/image/fetch/$s_!Nhjz!, /__u/andrealeonel.substack.com/w_1456, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8818b736-6f65-4072-b5d2-7f06f2cf0b76_889x367.png 1456w" sizes="100vw"><img src="/__u/substackcdn.com/image/fetch/$s_!Nhjz!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8818b736-6f65-4072-b5d2-7f06f2cf0b76_889x367.png" width="889" height="367" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/8818b736-6f65-4072-b5d2-7f06f2cf0b76_889x367.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:367,&quot;width&quot;:889,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:33638,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://andrealeonel.substack.com/i/184821948?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8818b736-6f65-4072-b5d2-7f06f2cf0b76_889x367.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="/__u/substackcdn.com/image/fetch/$s_!Nhjz!, /__u/andrealeonel.substack.com/w_424, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8818b736-6f65-4072-b5d2-7f06f2cf0b76_889x367.png 424w, /__u/substackcdn.com/image/fetch/$s_!Nhjz!, /__u/andrealeonel.substack.com/w_848, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8818b736-6f65-4072-b5d2-7f06f2cf0b76_889x367.png 848w, /__u/substackcdn.com/image/fetch/$s_!Nhjz!, /__u/andrealeonel.substack.com/w_1272, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8818b736-6f65-4072-b5d2-7f06f2cf0b76_889x367.png 1272w, /__u/substackcdn.com/image/fetch/$s_!Nhjz!, /__u/andrealeonel.substack.com/w_1456, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8818b736-6f65-4072-b5d2-7f06f2cf0b76_889x367.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption">It is possible to write expressions to test two columns together for uniqueness. Source: <a href="https://docs.getdbt.com/docs/build/data-tests#faqs">Add data tests to your DAG</a></figcaption></figure></div><p>There are additional configurations available for tests, which will be covered later in this Checkpoint.</p><p>Besides the native data tests, dbt also offers the ability to write <a href="/__u/andrealeonel.substack.com/p/options-for-custom-generic-testing">custom generic tests</a> and import them from Packages.</p><div><hr></div>]]></content:encoded></item><item><title><![CDATA[Practice Project 7: Python Model and Exposure]]></title><description><![CDATA[Adding our final resources (Python model and Exposure) and generating documentation.]]></description><link>https://andrealeonel.substack.com/p/practice-project-checkpoint-4-part-8cb</link><guid isPermaLink="false">https://andrealeonel.substack.com/p/practice-project-checkpoint-4-part-8cb</guid><dc:creator><![CDATA[Andrea Leonel]]></dc:creator><pubDate>Sun, 14 Dec 2025 22:40:11 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!QeIY!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F30821aab-91cd-40d9-a6d8-089b56b61b5f_1177x385.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p><em>Part of the <a href="/__u/andrealeonel.substack.com/p/study-for-the-dbt-analytics-engineering">&#8220;Mastering dbt&#8221;</a> series. Access to the full <a href="/__u/andrealeonel.substack.com/p/dbt-analytics-engineering-certification">Study Guide</a>. Let&#8217;s connect on <a href="https://www.linkedin.com/in/andrealeonel/">LinkedIn</a>!</em></p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://andrealeonel.substack.com/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption">Join hundreds of aspiring dbt developers &amp; data&nbsp;analysts!</p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="/__u/substackcdn.com/image/fetch/$s_!QeIY!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F30821aab-91cd-40d9-a6d8-089b56b61b5f_1177x385.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="/__u/substackcdn.com/image/fetch/$s_!QeIY!, /__u/andrealeonel.substack.com/w_424, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F30821aab-91cd-40d9-a6d8-089b56b61b5f_1177x385.png 424w, /__u/substackcdn.com/image/fetch/$s_!QeIY!, /__u/andrealeonel.substack.com/w_848, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F30821aab-91cd-40d9-a6d8-089b56b61b5f_1177x385.png 848w, /__u/substackcdn.com/image/fetch/$s_!QeIY!, /__u/andrealeonel.substack.com/w_1272, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F30821aab-91cd-40d9-a6d8-089b56b61b5f_1177x385.png 1272w, /__u/substackcdn.com/image/fetch/$s_!QeIY!, /__u/andrealeonel.substack.com/w_1456, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F30821aab-91cd-40d9-a6d8-089b56b61b5f_1177x385.png 1456w" sizes="100vw"><img src="/__u/substackcdn.com/image/fetch/$s_!QeIY!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F30821aab-91cd-40d9-a6d8-089b56b61b5f_1177x385.png" width="1177" height="385" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/30821aab-91cd-40d9-a6d8-089b56b61b5f_1177x385.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:385,&quot;width&quot;:1177,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:570916,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:&quot;https://andrealeonel.substack.com/i/181617995?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F30821aab-91cd-40d9-a6d8-089b56b61b5f_1177x385.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="/__u/substackcdn.com/image/fetch/$s_!QeIY!, /__u/andrealeonel.substack.com/w_424, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F30821aab-91cd-40d9-a6d8-089b56b61b5f_1177x385.png 424w, /__u/substackcdn.com/image/fetch/$s_!QeIY!, /__u/andrealeonel.substack.com/w_848, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F30821aab-91cd-40d9-a6d8-089b56b61b5f_1177x385.png 848w, /__u/substackcdn.com/image/fetch/$s_!QeIY!, /__u/andrealeonel.substack.com/w_1272, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F30821aab-91cd-40d9-a6d8-089b56b61b5f_1177x385.png 1272w, /__u/substackcdn.com/image/fetch/$s_!QeIY!, /__u/andrealeonel.substack.com/w_1456, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F30821aab-91cd-40d9-a6d8-089b56b61b5f_1177x385.png 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>We&#8217;ve arrived at the final part of our Practice Project - Checkpoint 4. This was definitely a heavy checkpoint, but at the end of this post you&#8217;ll see how mature our project looks now.</p><p>The next Checkpoint will cover data tests and deployment - lighter in content but no less important! </p><div><hr></div><h3>Python Models</h3><p>Let&#8217;s create a simple <a href="/__u/andrealeonel.substack.com/p/python-models">Python model</a> that calculates the lifetime value of each employee.</p><p>In real life, you wouldn&#8217;t use Python for such a banal calculation. SQL is always preferred on dbt. However, my Python skills are a bit rusty, so I&#8217;ll keep it simple.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="/__u/substackcdn.com/image/fetch/$s_!DERH!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F23b86bd4-9956-4b7f-991f-540dab1ca47f_1302x451.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="/__u/substackcdn.com/image/fetch/$s_!DERH!, /__u/andrealeonel.substack.com/w_424, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F23b86bd4-9956-4b7f-991f-540dab1ca47f_1302x451.png 424w, /__u/substackcdn.com/image/fetch/$s_!DERH!, /__u/andrealeonel.substack.com/w_848, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F23b86bd4-9956-4b7f-991f-540dab1ca47f_1302x451.png 848w, /__u/substackcdn.com/image/fetch/$s_!DERH!, /__u/andrealeonel.substack.com/w_1272, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F23b86bd4-9956-4b7f-991f-540dab1ca47f_1302x451.png 1272w, /__u/substackcdn.com/image/fetch/$s_!DERH!, /__u/andrealeonel.substack.com/w_1456, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F23b86bd4-9956-4b7f-991f-540dab1ca47f_1302x451.png 1456w" sizes="100vw"><img src="/__u/substackcdn.com/image/fetch/$s_!DERH!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F23b86bd4-9956-4b7f-991f-540dab1ca47f_1302x451.png" width="1302" height="451" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/23b86bd4-9956-4b7f-991f-540dab1ca47f_1302x451.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:451,&quot;width&quot;:1302,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:54949,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://andrealeonel.substack.com/i/181617995?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F23b86bd4-9956-4b7f-991f-540dab1ca47f_1302x451.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="/__u/substackcdn.com/image/fetch/$s_!DERH!, /__u/andrealeonel.substack.com/w_424, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F23b86bd4-9956-4b7f-991f-540dab1ca47f_1302x451.png 424w, /__u/substackcdn.com/image/fetch/$s_!DERH!, /__u/andrealeonel.substack.com/w_848, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F23b86bd4-9956-4b7f-991f-540dab1ca47f_1302x451.png 848w, /__u/substackcdn.com/image/fetch/$s_!DERH!, /__u/andrealeonel.substack.com/w_1272, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F23b86bd4-9956-4b7f-991f-540dab1ca47f_1302x451.png 1272w, /__u/substackcdn.com/image/fetch/$s_!DERH!, /__u/andrealeonel.substack.com/w_1456, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F23b86bd4-9956-4b7f-991f-540dab1ca47f_1302x451.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption">This simple aggregation is summing the order_value by emp_id.</figcaption></figure></div><p>The next step is to configure the newly created model. We are going to materialise it as a table.</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="/__u/substackcdn.com/image/fetch/$s_!Zw93!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcf7da7e0-0a4e-493f-a309-1330967fa202_1309x292.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="/__u/substackcdn.com/image/fetch/$s_!Zw93!, /__u/andrealeonel.substack.com/w_424, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcf7da7e0-0a4e-493f-a309-1330967fa202_1309x292.png 424w, /__u/substackcdn.com/image/fetch/$s_!Zw93!, /__u/andrealeonel.substack.com/w_848, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcf7da7e0-0a4e-493f-a309-1330967fa202_1309x292.png 848w, /__u/substackcdn.com/image/fetch/$s_!Zw93!, /__u/andrealeonel.substack.com/w_1272, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcf7da7e0-0a4e-493f-a309-1330967fa202_1309x292.png 1272w, /__u/substackcdn.com/image/fetch/$s_!Zw93!, /__u/andrealeonel.substack.com/w_1456, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcf7da7e0-0a4e-493f-a309-1330967fa202_1309x292.png 1456w" sizes="100vw"><img src="/__u/substackcdn.com/image/fetch/$s_!Zw93!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcf7da7e0-0a4e-493f-a309-1330967fa202_1309x292.png" width="1309" height="292" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/cf7da7e0-0a4e-493f-a309-1330967fa202_1309x292.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:292,&quot;width&quot;:1309,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:32967,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://andrealeonel.substack.com/i/181617995?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcf7da7e0-0a4e-493f-a309-1330967fa202_1309x292.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="/__u/substackcdn.com/image/fetch/$s_!Zw93!, /__u/andrealeonel.substack.com/w_424, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcf7da7e0-0a4e-493f-a309-1330967fa202_1309x292.png 424w, /__u/substackcdn.com/image/fetch/$s_!Zw93!, /__u/andrealeonel.substack.com/w_848, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcf7da7e0-0a4e-493f-a309-1330967fa202_1309x292.png 848w, /__u/substackcdn.com/image/fetch/$s_!Zw93!, /__u/andrealeonel.substack.com/w_1272, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcf7da7e0-0a4e-493f-a309-1330967fa202_1309x292.png 1272w, /__u/substackcdn.com/image/fetch/$s_!Zw93!, /__u/andrealeonel.substack.com/w_1456, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcf7da7e0-0a4e-493f-a309-1330967fa202_1309x292.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a><figcaption class="image-caption">Simple configuration on dbt_project.yml.</figcaption></figure></div><p>Now, we are going to run the model. As usual, because I have billing disabled in BigQuery, I&#8217;m not able to run it successfully. There would be ways to run this locally, but it would involve more advanced features.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="/__u/substackcdn.com/image/fetch/$s_!aVqv!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faf4d874e-f58b-4d9c-a31d-1a62018bec98_951x502.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="/__u/substackcdn.com/image/fetch/$s_!aVqv!, /__u/andrealeonel.substack.com/w_424, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faf4d874e-f58b-4d9c-a31d-1a62018bec98_951x502.png 424w, /__u/substackcdn.com/image/fetch/$s_!aVqv!, /__u/andrealeonel.substack.com/w_848, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faf4d874e-f58b-4d9c-a31d-1a62018bec98_951x502.png 848w, /__u/substackcdn.com/image/fetch/$s_!aVqv!, /__u/andrealeonel.substack.com/w_1272, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faf4d874e-f58b-4d9c-a31d-1a62018bec98_951x502.png 1272w, /__u/substackcdn.com/image/fetch/$s_!aVqv!, /__u/andrealeonel.substack.com/w_1456, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faf4d874e-f58b-4d9c-a31d-1a62018bec98_951x502.png 1456w" sizes="100vw"><img src="/__u/substackcdn.com/image/fetch/$s_!aVqv!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faf4d874e-f58b-4d9c-a31d-1a62018bec98_951x502.png" width="951" height="502" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/af4d874e-f58b-4d9c-a31d-1a62018bec98_951x502.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:502,&quot;width&quot;:951,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:93506,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://andrealeonel.substack.com/i/181617995?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faf4d874e-f58b-4d9c-a31d-1a62018bec98_951x502.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="/__u/substackcdn.com/image/fetch/$s_!aVqv!, /__u/andrealeonel.substack.com/w_424, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faf4d874e-f58b-4d9c-a31d-1a62018bec98_951x502.png 424w, /__u/substackcdn.com/image/fetch/$s_!aVqv!, /__u/andrealeonel.substack.com/w_848, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faf4d874e-f58b-4d9c-a31d-1a62018bec98_951x502.png 848w, /__u/substackcdn.com/image/fetch/$s_!aVqv!, /__u/andrealeonel.substack.com/w_1272, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faf4d874e-f58b-4d9c-a31d-1a62018bec98_951x502.png 1272w, /__u/substackcdn.com/image/fetch/$s_!aVqv!, /__u/andrealeonel.substack.com/w_1456, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faf4d874e-f58b-4d9c-a31d-1a62018bec98_951x502.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption">I&#8217;d need a GCP Bucket and a compute_region setting to run this</figcaption></figure></div><p>The important thing is that we understand the minimal requirements of Python model configuration, how to use the &#8220;model&#8221; function, and test the ability to reference sql models.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="/__u/substackcdn.com/image/fetch/$s_!XHkk!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8ab609fd-a7b9-457c-9b5a-ccc68918fc23_1321x577.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="/__u/substackcdn.com/image/fetch/$s_!XHkk!, /__u/andrealeonel.substack.com/w_424, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8ab609fd-a7b9-457c-9b5a-ccc68918fc23_1321x577.png 424w, /__u/substackcdn.com/image/fetch/$s_!XHkk!, /__u/andrealeonel.substack.com/w_848, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8ab609fd-a7b9-457c-9b5a-ccc68918fc23_1321x577.png 848w, /__u/substackcdn.com/image/fetch/$s_!XHkk!, /__u/andrealeonel.substack.com/w_1272, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8ab609fd-a7b9-457c-9b5a-ccc68918fc23_1321x577.png 1272w, /__u/substackcdn.com/image/fetch/$s_!XHkk!, /__u/andrealeonel.substack.com/w_1456, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8ab609fd-a7b9-457c-9b5a-ccc68918fc23_1321x577.png 1456w" sizes="100vw"><img src="/__u/substackcdn.com/image/fetch/$s_!XHkk!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8ab609fd-a7b9-457c-9b5a-ccc68918fc23_1321x577.png" width="1321" height="577" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/8ab609fd-a7b9-457c-9b5a-ccc68918fc23_1321x577.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:577,&quot;width&quot;:1321,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:97195,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://andrealeonel.substack.com/i/181617995?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8ab609fd-a7b9-457c-9b5a-ccc68918fc23_1321x577.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="/__u/substackcdn.com/image/fetch/$s_!XHkk!, /__u/andrealeonel.substack.com/w_424, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8ab609fd-a7b9-457c-9b5a-ccc68918fc23_1321x577.png 424w, /__u/substackcdn.com/image/fetch/$s_!XHkk!, /__u/andrealeonel.substack.com/w_848, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8ab609fd-a7b9-457c-9b5a-ccc68918fc23_1321x577.png 848w, /__u/substackcdn.com/image/fetch/$s_!XHkk!, /__u/andrealeonel.substack.com/w_1272, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8ab609fd-a7b9-457c-9b5a-ccc68918fc23_1321x577.png 1272w, /__u/substackcdn.com/image/fetch/$s_!XHkk!, /__u/andrealeonel.substack.com/w_1456, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8ab609fd-a7b9-457c-9b5a-ccc68918fc23_1321x577.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption">The Compiled Code shows how dbt logic works behind the scenes.</figcaption></figure></div><div><hr></div><h3>Exposures</h3><p>We&#8217;re modeling all this data for our B2B company so that the end-users can access clean, consistent data via a visualisation tool such as Power BI or Tableau.</p><p>Creating the actual dashboard is out of scope here, but we can practice configuring a dashboard as an <a href="/__u/andrealeonel.substack.com/p/all-you-need-to-know-about-dbts-exposures">Exposure</a>.</p><p>The first step is to configure our Exposure in an exposure.yml file:</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="/__u/substackcdn.com/image/fetch/$s_!aqiG!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F64023d13-4a92-40ab-91d5-6bc0c57a8ffb_1339x511.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="/__u/substackcdn.com/image/fetch/$s_!aqiG!, /__u/andrealeonel.substack.com/w_424, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F64023d13-4a92-40ab-91d5-6bc0c57a8ffb_1339x511.png 424w, /__u/substackcdn.com/image/fetch/$s_!aqiG!, /__u/andrealeonel.substack.com/w_848, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F64023d13-4a92-40ab-91d5-6bc0c57a8ffb_1339x511.png 848w, /__u/substackcdn.com/image/fetch/$s_!aqiG!, /__u/andrealeonel.substack.com/w_1272, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F64023d13-4a92-40ab-91d5-6bc0c57a8ffb_1339x511.png 1272w, /__u/substackcdn.com/image/fetch/$s_!aqiG!, /__u/andrealeonel.substack.com/w_1456, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F64023d13-4a92-40ab-91d5-6bc0c57a8ffb_1339x511.png 1456w" sizes="100vw"><img src="/__u/substackcdn.com/image/fetch/$s_!aqiG!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F64023d13-4a92-40ab-91d5-6bc0c57a8ffb_1339x511.png" width="1339" height="511" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/64023d13-4a92-40ab-91d5-6bc0c57a8ffb_1339x511.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:511,&quot;width&quot;:1339,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:65693,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://andrealeonel.substack.com/i/181617995?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F64023d13-4a92-40ab-91d5-6bc0c57a8ffb_1339x511.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="/__u/substackcdn.com/image/fetch/$s_!aqiG!, /__u/andrealeonel.substack.com/w_424, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F64023d13-4a92-40ab-91d5-6bc0c57a8ffb_1339x511.png 424w, /__u/substackcdn.com/image/fetch/$s_!aqiG!, /__u/andrealeonel.substack.com/w_848, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F64023d13-4a92-40ab-91d5-6bc0c57a8ffb_1339x511.png 848w, /__u/substackcdn.com/image/fetch/$s_!aqiG!, /__u/andrealeonel.substack.com/w_1272, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F64023d13-4a92-40ab-91d5-6bc0c57a8ffb_1339x511.png 1272w, /__u/substackcdn.com/image/fetch/$s_!aqiG!, /__u/andrealeonel.substack.com/w_1456, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F64023d13-4a92-40ab-91d5-6bc0c57a8ffb_1339x511.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption">Exposures require a separate properties file stored in the models folder.</figcaption></figure></div><p>Not all these configs are required and you can make it as robust or simple as you&#8217;d like.</p><p>Finally, we are going to run our new Exposure so it becomes a node in the DAG.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="/__u/substackcdn.com/image/fetch/$s_!GKNB!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F56689785-09fa-48a6-ad37-20e2c8162e66_945x504.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="/__u/substackcdn.com/image/fetch/$s_!GKNB!, /__u/andrealeonel.substack.com/w_424, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F56689785-09fa-48a6-ad37-20e2c8162e66_945x504.png 424w, /__u/substackcdn.com/image/fetch/$s_!GKNB!, /__u/andrealeonel.substack.com/w_848, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F56689785-09fa-48a6-ad37-20e2c8162e66_945x504.png 848w, /__u/substackcdn.com/image/fetch/$s_!GKNB!, /__u/andrealeonel.substack.com/w_1272, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F56689785-09fa-48a6-ad37-20e2c8162e66_945x504.png 1272w, /__u/substackcdn.com/image/fetch/$s_!GKNB!, /__u/andrealeonel.substack.com/w_1456, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F56689785-09fa-48a6-ad37-20e2c8162e66_945x504.png 1456w" sizes="100vw"><img src="/__u/substackcdn.com/image/fetch/$s_!GKNB!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F56689785-09fa-48a6-ad37-20e2c8162e66_945x504.png" width="945" height="504" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/56689785-09fa-48a6-ad37-20e2c8162e66_945x504.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:504,&quot;width&quot;:945,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:77620,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://andrealeonel.substack.com/i/181617995?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F56689785-09fa-48a6-ad37-20e2c8162e66_945x504.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="/__u/substackcdn.com/image/fetch/$s_!GKNB!, /__u/andrealeonel.substack.com/w_424, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F56689785-09fa-48a6-ad37-20e2c8162e66_945x504.png 424w, /__u/substackcdn.com/image/fetch/$s_!GKNB!, /__u/andrealeonel.substack.com/w_848, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F56689785-09fa-48a6-ad37-20e2c8162e66_945x504.png 848w, /__u/substackcdn.com/image/fetch/$s_!GKNB!, /__u/andrealeonel.substack.com/w_1272, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F56689785-09fa-48a6-ad37-20e2c8162e66_945x504.png 1272w, /__u/substackcdn.com/image/fetch/$s_!GKNB!, /__u/andrealeonel.substack.com/w_1456, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F56689785-09fa-48a6-ad37-20e2c8162e66_945x504.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption">Running the exposure config we just created.</figcaption></figure></div><p>Please note I have a deprecation flag on, as dbt recently started requiring the docs config to be under a &#8220;config:&#8221; block. </p><p>After a successful run, you should now see the Exposure as part of your DAG. I&#8217;ll add a small detail: fact tables should be in a single layer, as per dbt&#8217;s best practices, so do what I say and not what I do!</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="/__u/substackcdn.com/image/fetch/$s_!WtY9!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbcaa6ff3-e441-4391-a728-457b7e5661e1_1464x484.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="/__u/substackcdn.com/image/fetch/$s_!WtY9!, /__u/andrealeonel.substack.com/w_424, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbcaa6ff3-e441-4391-a728-457b7e5661e1_1464x484.png 424w, /__u/substackcdn.com/image/fetch/$s_!WtY9!, /__u/andrealeonel.substack.com/w_848, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbcaa6ff3-e441-4391-a728-457b7e5661e1_1464x484.png 848w, /__u/substackcdn.com/image/fetch/$s_!WtY9!, /__u/andrealeonel.substack.com/w_1272, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbcaa6ff3-e441-4391-a728-457b7e5661e1_1464x484.png 1272w, /__u/substackcdn.com/image/fetch/$s_!WtY9!, /__u/andrealeonel.substack.com/w_1456, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbcaa6ff3-e441-4391-a728-457b7e5661e1_1464x484.png 1456w" sizes="100vw"><img src="/__u/substackcdn.com/image/fetch/$s_!WtY9!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbcaa6ff3-e441-4391-a728-457b7e5661e1_1464x484.png" width="1456" height="481" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/bcaa6ff3-e441-4391-a728-457b7e5661e1_1464x484.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:481,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:137626,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://andrealeonel.substack.com/i/181617995?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbcaa6ff3-e441-4391-a728-457b7e5661e1_1464x484.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="/__u/substackcdn.com/image/fetch/$s_!WtY9!, /__u/andrealeonel.substack.com/w_424, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbcaa6ff3-e441-4391-a728-457b7e5661e1_1464x484.png 424w, /__u/substackcdn.com/image/fetch/$s_!WtY9!, /__u/andrealeonel.substack.com/w_848, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbcaa6ff3-e441-4391-a728-457b7e5661e1_1464x484.png 848w, /__u/substackcdn.com/image/fetch/$s_!WtY9!, /__u/andrealeonel.substack.com/w_1272, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbcaa6ff3-e441-4391-a728-457b7e5661e1_1464x484.png 1272w, /__u/substackcdn.com/image/fetch/$s_!WtY9!, /__u/andrealeonel.substack.com/w_1456, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbcaa6ff3-e441-4391-a728-457b7e5661e1_1464x484.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption">Look at our DAG looking so grown up!</figcaption></figure></div><div><hr></div><h3>Documentation</h3><p>The last step of this very long Checkpoint is to <a href="/__u/andrealeonel.substack.com/p/generating-documentation-with-dbt">add and configure documentation</a> in our project.</p><p>Throughout our project, we&#8217;ve been adding descriptions to sources and other resources:</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="/__u/substackcdn.com/image/fetch/$s_!ZxbC!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdc54069d-d9cf-4367-8ef2-f4ea48e58fa4_1336x778.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="/__u/substackcdn.com/image/fetch/$s_!ZxbC!, /__u/andrealeonel.substack.com/w_424, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdc54069d-d9cf-4367-8ef2-f4ea48e58fa4_1336x778.png 424w, /__u/substackcdn.com/image/fetch/$s_!ZxbC!, /__u/andrealeonel.substack.com/w_848, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdc54069d-d9cf-4367-8ef2-f4ea48e58fa4_1336x778.png 848w, /__u/substackcdn.com/image/fetch/$s_!ZxbC!, /__u/andrealeonel.substack.com/w_1272, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdc54069d-d9cf-4367-8ef2-f4ea48e58fa4_1336x778.png 1272w, /__u/substackcdn.com/image/fetch/$s_!ZxbC!, /__u/andrealeonel.substack.com/w_1456, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdc54069d-d9cf-4367-8ef2-f4ea48e58fa4_1336x778.png 1456w" sizes="100vw"><img src="/__u/substackcdn.com/image/fetch/$s_!ZxbC!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdc54069d-d9cf-4367-8ef2-f4ea48e58fa4_1336x778.png" width="1336" height="778" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/dc54069d-d9cf-4367-8ef2-f4ea48e58fa4_1336x778.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:778,&quot;width&quot;:1336,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:101022,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://andrealeonel.substack.com/i/181617995?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdc54069d-d9cf-4367-8ef2-f4ea48e58fa4_1336x778.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="/__u/substackcdn.com/image/fetch/$s_!ZxbC!, /__u/andrealeonel.substack.com/w_424, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdc54069d-d9cf-4367-8ef2-f4ea48e58fa4_1336x778.png 424w, /__u/substackcdn.com/image/fetch/$s_!ZxbC!, /__u/andrealeonel.substack.com/w_848, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdc54069d-d9cf-4367-8ef2-f4ea48e58fa4_1336x778.png 848w, /__u/substackcdn.com/image/fetch/$s_!ZxbC!, /__u/andrealeonel.substack.com/w_1272, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdc54069d-d9cf-4367-8ef2-f4ea48e58fa4_1336x778.png 1272w, /__u/substackcdn.com/image/fetch/$s_!ZxbC!, /__u/andrealeonel.substack.com/w_1456, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdc54069d-d9cf-4367-8ef2-f4ea48e58fa4_1336x778.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption">The description property used in Sources.yml</figcaption></figure></div><p>However, our fct_orders model is quite an important one and includes complex discount and VAT logic. Therefore, for that model, we&#8217;re going to include a doc block for a more thorough description.</p><p>For that, we need to create a docs.md (optionally in a docs folder within models), where we can store all doc blocks we may need.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="/__u/substackcdn.com/image/fetch/$s_!NjG7!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe2182427-2b8e-4571-a77f-bf58874cab74_1335x831.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="/__u/substackcdn.com/image/fetch/$s_!NjG7!, /__u/andrealeonel.substack.com/w_424, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe2182427-2b8e-4571-a77f-bf58874cab74_1335x831.png 424w, /__u/substackcdn.com/image/fetch/$s_!NjG7!, /__u/andrealeonel.substack.com/w_848, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe2182427-2b8e-4571-a77f-bf58874cab74_1335x831.png 848w, /__u/substackcdn.com/image/fetch/$s_!NjG7!, /__u/andrealeonel.substack.com/w_1272, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe2182427-2b8e-4571-a77f-bf58874cab74_1335x831.png 1272w, /__u/substackcdn.com/image/fetch/$s_!NjG7!, /__u/andrealeonel.substack.com/w_1456, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe2182427-2b8e-4571-a77f-bf58874cab74_1335x831.png 1456w" sizes="100vw"><img src="/__u/substackcdn.com/image/fetch/$s_!NjG7!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe2182427-2b8e-4571-a77f-bf58874cab74_1335x831.png" width="1335" height="831" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/e2182427-2b8e-4571-a77f-bf58874cab74_1335x831.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:831,&quot;width&quot;:1335,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:114092,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://andrealeonel.substack.com/i/181617995?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe2182427-2b8e-4571-a77f-bf58874cab74_1335x831.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="/__u/substackcdn.com/image/fetch/$s_!NjG7!, /__u/andrealeonel.substack.com/w_424, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe2182427-2b8e-4571-a77f-bf58874cab74_1335x831.png 424w, /__u/substackcdn.com/image/fetch/$s_!NjG7!, /__u/andrealeonel.substack.com/w_848, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe2182427-2b8e-4571-a77f-bf58874cab74_1335x831.png 848w, /__u/substackcdn.com/image/fetch/$s_!NjG7!, /__u/andrealeonel.substack.com/w_1272, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe2182427-2b8e-4571-a77f-bf58874cab74_1335x831.png 1272w, /__u/substackcdn.com/image/fetch/$s_!NjG7!, /__u/andrealeonel.substack.com/w_1456, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe2182427-2b8e-4571-a77f-bf58874cab74_1335x831.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption">A thorough explanation of the logic behind the fct_orders model in a doc block.</figcaption></figure></div><p>In the fct_orders model, let&#8217;s replace the standard description we had in the properties.yml file with our doc bloc.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="/__u/substackcdn.com/image/fetch/$s_!nrTi!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F443ba3f9-f3f4-4919-a8ee-00b3d9b41216_1311x433.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="/__u/substackcdn.com/image/fetch/$s_!nrTi!, /__u/andrealeonel.substack.com/w_424, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F443ba3f9-f3f4-4919-a8ee-00b3d9b41216_1311x433.png 424w, /__u/substackcdn.com/image/fetch/$s_!nrTi!, /__u/andrealeonel.substack.com/w_848, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F443ba3f9-f3f4-4919-a8ee-00b3d9b41216_1311x433.png 848w, /__u/substackcdn.com/image/fetch/$s_!nrTi!, /__u/andrealeonel.substack.com/w_1272, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F443ba3f9-f3f4-4919-a8ee-00b3d9b41216_1311x433.png 1272w, /__u/substackcdn.com/image/fetch/$s_!nrTi!, /__u/andrealeonel.substack.com/w_1456, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F443ba3f9-f3f4-4919-a8ee-00b3d9b41216_1311x433.png 1456w" sizes="100vw"><img src="/__u/substackcdn.com/image/fetch/$s_!nrTi!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F443ba3f9-f3f4-4919-a8ee-00b3d9b41216_1311x433.png" width="1311" height="433" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/443ba3f9-f3f4-4919-a8ee-00b3d9b41216_1311x433.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:433,&quot;width&quot;:1311,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:50743,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://andrealeonel.substack.com/i/181617995?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F443ba3f9-f3f4-4919-a8ee-00b3d9b41216_1311x433.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="/__u/substackcdn.com/image/fetch/$s_!nrTi!, /__u/andrealeonel.substack.com/w_424, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F443ba3f9-f3f4-4919-a8ee-00b3d9b41216_1311x433.png 424w, /__u/substackcdn.com/image/fetch/$s_!nrTi!, /__u/andrealeonel.substack.com/w_848, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F443ba3f9-f3f4-4919-a8ee-00b3d9b41216_1311x433.png 848w, /__u/substackcdn.com/image/fetch/$s_!nrTi!, /__u/andrealeonel.substack.com/w_1272, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F443ba3f9-f3f4-4919-a8ee-00b3d9b41216_1311x433.png 1272w, /__u/substackcdn.com/image/fetch/$s_!nrTi!, /__u/andrealeonel.substack.com/w_1456, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F443ba3f9-f3f4-4919-a8ee-00b3d9b41216_1311x433.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption">Linking a model description to a doc block.</figcaption></figure></div><p>Finally, we can generate the docs (compile all the descriptions, metadata, and doc blocks) and then serve them to a bespoke webpage.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="/__u/substackcdn.com/image/fetch/$s_!MPKw!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc8b7d695-2ba0-44d1-b6d5-028cca0d84db_952x358.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="/__u/substackcdn.com/image/fetch/$s_!MPKw!, /__u/andrealeonel.substack.com/w_424, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc8b7d695-2ba0-44d1-b6d5-028cca0d84db_952x358.png 424w, /__u/substackcdn.com/image/fetch/$s_!MPKw!, /__u/andrealeonel.substack.com/w_848, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc8b7d695-2ba0-44d1-b6d5-028cca0d84db_952x358.png 848w, /__u/substackcdn.com/image/fetch/$s_!MPKw!, /__u/andrealeonel.substack.com/w_1272, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc8b7d695-2ba0-44d1-b6d5-028cca0d84db_952x358.png 1272w, /__u/substackcdn.com/image/fetch/$s_!MPKw!, /__u/andrealeonel.substack.com/w_1456, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc8b7d695-2ba0-44d1-b6d5-028cca0d84db_952x358.png 1456w" sizes="100vw"><img src="/__u/substackcdn.com/image/fetch/$s_!MPKw!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc8b7d695-2ba0-44d1-b6d5-028cca0d84db_952x358.png" width="952" height="358" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/c8b7d695-2ba0-44d1-b6d5-028cca0d84db_952x358.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:358,&quot;width&quot;:952,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:39784,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://andrealeonel.substack.com/i/181617995?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc8b7d695-2ba0-44d1-b6d5-028cca0d84db_952x358.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="/__u/substackcdn.com/image/fetch/$s_!MPKw!, /__u/andrealeonel.substack.com/w_424, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc8b7d695-2ba0-44d1-b6d5-028cca0d84db_952x358.png 424w, /__u/substackcdn.com/image/fetch/$s_!MPKw!, /__u/andrealeonel.substack.com/w_848, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc8b7d695-2ba0-44d1-b6d5-028cca0d84db_952x358.png 848w, /__u/substackcdn.com/image/fetch/$s_!MPKw!, /__u/andrealeonel.substack.com/w_1272, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc8b7d695-2ba0-44d1-b6d5-028cca0d84db_952x358.png 1272w, /__u/substackcdn.com/image/fetch/$s_!MPKw!, /__u/andrealeonel.substack.com/w_1456, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc8b7d695-2ba0-44d1-b6d5-028cca0d84db_952x358.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption">Our docs were generated successfully.</figcaption></figure></div><p>I&#8217;m using the IDE, so I don&#8217;t need to serve the docs. The next step is to click the docs button to see our docs website:</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="/__u/substackcdn.com/image/fetch/$s_!Y-Rv!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8f7c1ee7-efd1-4d4f-8e95-7f462e6101a2_943x337.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="/__u/substackcdn.com/image/fetch/$s_!Y-Rv!, /__u/andrealeonel.substack.com/w_424, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8f7c1ee7-efd1-4d4f-8e95-7f462e6101a2_943x337.png 424w, /__u/substackcdn.com/image/fetch/$s_!Y-Rv!, /__u/andrealeonel.substack.com/w_848, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8f7c1ee7-efd1-4d4f-8e95-7f462e6101a2_943x337.png 848w, /__u/substackcdn.com/image/fetch/$s_!Y-Rv!, /__u/andrealeonel.substack.com/w_1272, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8f7c1ee7-efd1-4d4f-8e95-7f462e6101a2_943x337.png 1272w, /__u/substackcdn.com/image/fetch/$s_!Y-Rv!, /__u/andrealeonel.substack.com/w_1456, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8f7c1ee7-efd1-4d4f-8e95-7f462e6101a2_943x337.png 1456w" sizes="100vw"><img src="/__u/substackcdn.com/image/fetch/$s_!Y-Rv!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8f7c1ee7-efd1-4d4f-8e95-7f462e6101a2_943x337.png" width="943" height="337" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/8f7c1ee7-efd1-4d4f-8e95-7f462e6101a2_943x337.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:337,&quot;width&quot;:943,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:60934,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://andrealeonel.substack.com/i/181617995?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8f7c1ee7-efd1-4d4f-8e95-7f462e6101a2_943x337.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="/__u/substackcdn.com/image/fetch/$s_!Y-Rv!, /__u/andrealeonel.substack.com/w_424, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8f7c1ee7-efd1-4d4f-8e95-7f462e6101a2_943x337.png 424w, /__u/substackcdn.com/image/fetch/$s_!Y-Rv!, /__u/andrealeonel.substack.com/w_848, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8f7c1ee7-efd1-4d4f-8e95-7f462e6101a2_943x337.png 848w, /__u/substackcdn.com/image/fetch/$s_!Y-Rv!, /__u/andrealeonel.substack.com/w_1272, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8f7c1ee7-efd1-4d4f-8e95-7f462e6101a2_943x337.png 1272w, /__u/substackcdn.com/image/fetch/$s_!Y-Rv!, /__u/andrealeonel.substack.com/w_1456, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8f7c1ee7-efd1-4d4f-8e95-7f462e6101a2_943x337.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption">The docs button is easy to miss for those not used to dbt&#8217;s IDE.</figcaption></figure></div><p>And there we have our brand new docs page. There are other ways to customise it, by creating an overview.md doc block to replace the text in the homepage, but we&#8217;ll keep it simple for now.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="/__u/substackcdn.com/image/fetch/$s_!TpMp!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fde745d27-62bd-45bd-b0a9-8de98157307a_1888x927.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="/__u/substackcdn.com/image/fetch/$s_!TpMp!, /__u/andrealeonel.substack.com/w_424, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fde745d27-62bd-45bd-b0a9-8de98157307a_1888x927.png 424w, /__u/substackcdn.com/image/fetch/$s_!TpMp!, /__u/andrealeonel.substack.com/w_848, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fde745d27-62bd-45bd-b0a9-8de98157307a_1888x927.png 848w, /__u/substackcdn.com/image/fetch/$s_!TpMp!, /__u/andrealeonel.substack.com/w_1272, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fde745d27-62bd-45bd-b0a9-8de98157307a_1888x927.png 1272w, /__u/substackcdn.com/image/fetch/$s_!TpMp!, /__u/andrealeonel.substack.com/w_1456, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fde745d27-62bd-45bd-b0a9-8de98157307a_1888x927.png 1456w" sizes="100vw"><img src="/__u/substackcdn.com/image/fetch/$s_!TpMp!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fde745d27-62bd-45bd-b0a9-8de98157307a_1888x927.png" width="1456" height="715" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/de745d27-62bd-45bd-b0a9-8de98157307a_1888x927.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:715,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:156005,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://andrealeonel.substack.com/i/181617995?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fde745d27-62bd-45bd-b0a9-8de98157307a_1888x927.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="/__u/substackcdn.com/image/fetch/$s_!TpMp!, /__u/andrealeonel.substack.com/w_424, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fde745d27-62bd-45bd-b0a9-8de98157307a_1888x927.png 424w, /__u/substackcdn.com/image/fetch/$s_!TpMp!, /__u/andrealeonel.substack.com/w_848, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fde745d27-62bd-45bd-b0a9-8de98157307a_1888x927.png 848w, /__u/substackcdn.com/image/fetch/$s_!TpMp!, /__u/andrealeonel.substack.com/w_1272, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fde745d27-62bd-45bd-b0a9-8de98157307a_1888x927.png 1272w, /__u/substackcdn.com/image/fetch/$s_!TpMp!, /__u/andrealeonel.substack.com/w_1456, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fde745d27-62bd-45bd-b0a9-8de98157307a_1888x927.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption">Our dbt-generated documentation page.</figcaption></figure></div><p>We can also see our doc block for fct_orders in action:</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="/__u/substackcdn.com/image/fetch/$s_!4b8s!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F91f7fe31-f9c6-4573-9876-9ae52f3fa587_1846x820.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="/__u/substackcdn.com/image/fetch/$s_!4b8s!, /__u/andrealeonel.substack.com/w_424, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F91f7fe31-f9c6-4573-9876-9ae52f3fa587_1846x820.png 424w, /__u/substackcdn.com/image/fetch/$s_!4b8s!, /__u/andrealeonel.substack.com/w_848, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F91f7fe31-f9c6-4573-9876-9ae52f3fa587_1846x820.png 848w, /__u/substackcdn.com/image/fetch/$s_!4b8s!, /__u/andrealeonel.substack.com/w_1272, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F91f7fe31-f9c6-4573-9876-9ae52f3fa587_1846x820.png 1272w, /__u/substackcdn.com/image/fetch/$s_!4b8s!, /__u/andrealeonel.substack.com/w_1456, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F91f7fe31-f9c6-4573-9876-9ae52f3fa587_1846x820.png 1456w" sizes="100vw"><img src="/__u/substackcdn.com/image/fetch/$s_!4b8s!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F91f7fe31-f9c6-4573-9876-9ae52f3fa587_1846x820.png" width="1456" height="647" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/91f7fe31-f9c6-4573-9876-9ae52f3fa587_1846x820.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:647,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:147326,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://andrealeonel.substack.com/i/181617995?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F91f7fe31-f9c6-4573-9876-9ae52f3fa587_1846x820.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="/__u/substackcdn.com/image/fetch/$s_!4b8s!, /__u/andrealeonel.substack.com/w_424, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F91f7fe31-f9c6-4573-9876-9ae52f3fa587_1846x820.png 424w, /__u/substackcdn.com/image/fetch/$s_!4b8s!, /__u/andrealeonel.substack.com/w_848, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F91f7fe31-f9c6-4573-9876-9ae52f3fa587_1846x820.png 848w, /__u/substackcdn.com/image/fetch/$s_!4b8s!, /__u/andrealeonel.substack.com/w_1272, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F91f7fe31-f9c6-4573-9876-9ae52f3fa587_1846x820.png 1272w, /__u/substackcdn.com/image/fetch/$s_!4b8s!, /__u/andrealeonel.substack.com/w_1456, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F91f7fe31-f9c6-4573-9876-9ae52f3fa587_1846x820.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption">Our thorough description for the fct_orders model.</figcaption></figure></div><p>And finally, a complete visualisation of our DAG with colour-coded nodes.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="/__u/substackcdn.com/image/fetch/$s_!2F1V!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdf7931c9-1bb0-4230-8cb4-b6a139001b6d_1816x739.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="/__u/substackcdn.com/image/fetch/$s_!2F1V!, /__u/andrealeonel.substack.com/w_424, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdf7931c9-1bb0-4230-8cb4-b6a139001b6d_1816x739.png 424w, /__u/substackcdn.com/image/fetch/$s_!2F1V!, /__u/andrealeonel.substack.com/w_848, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdf7931c9-1bb0-4230-8cb4-b6a139001b6d_1816x739.png 848w, /__u/substackcdn.com/image/fetch/$s_!2F1V!, /__u/andrealeonel.substack.com/w_1272, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdf7931c9-1bb0-4230-8cb4-b6a139001b6d_1816x739.png 1272w, /__u/substackcdn.com/image/fetch/$s_!2F1V!, /__u/andrealeonel.substack.com/w_1456, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdf7931c9-1bb0-4230-8cb4-b6a139001b6d_1816x739.png 1456w" sizes="100vw"><img src="/__u/substackcdn.com/image/fetch/$s_!2F1V!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdf7931c9-1bb0-4230-8cb4-b6a139001b6d_1816x739.png" width="1456" height="593" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/df7931c9-1bb0-4230-8cb4-b6a139001b6d_1816x739.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:593,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:178849,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://andrealeonel.substack.com/i/181617995?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdf7931c9-1bb0-4230-8cb4-b6a139001b6d_1816x739.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="/__u/substackcdn.com/image/fetch/$s_!2F1V!, /__u/andrealeonel.substack.com/w_424, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdf7931c9-1bb0-4230-8cb4-b6a139001b6d_1816x739.png 424w, /__u/substackcdn.com/image/fetch/$s_!2F1V!, /__u/andrealeonel.substack.com/w_848, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdf7931c9-1bb0-4230-8cb4-b6a139001b6d_1816x739.png 848w, /__u/substackcdn.com/image/fetch/$s_!2F1V!, /__u/andrealeonel.substack.com/w_1272, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdf7931c9-1bb0-4230-8cb4-b6a139001b6d_1816x739.png 1272w, /__u/substackcdn.com/image/fetch/$s_!2F1V!, /__u/andrealeonel.substack.com/w_1456, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdf7931c9-1bb0-4230-8cb4-b6a139001b6d_1816x739.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div>]]></content:encoded></item><item><title><![CDATA[Practice Project 6: Snapshots and Grants]]></title><description><![CDATA[Playing with Grants and adding Snapshots to our Practice Project.]]></description><link>https://andrealeonel.substack.com/p/practice-project-checkpoint-4-part-d2f</link><guid isPermaLink="false">https://andrealeonel.substack.com/p/practice-project-checkpoint-4-part-d2f</guid><dc:creator><![CDATA[Andrea Leonel]]></dc:creator><pubDate>Sun, 07 Dec 2025 23:49:03 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!4uL0!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3dff95c2-a1e8-4990-b37b-fa8353548e47_1176x376.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p><em>Part of the <a href="/__u/andrealeonel.substack.com/p/study-for-the-dbt-analytics-engineering">&#8220;Mastering dbt&#8221;</a> series. Access to the full <a href="/__u/andrealeonel.substack.com/p/dbt-analytics-engineering-certification">Study Guide</a>. Let&#8217;s connect on <a href="https://www.linkedin.com/in/andrealeonel/">LinkedIn</a>!</em></p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://andrealeonel.substack.com/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption">Join hundreds of aspiring dbt developers &amp; data&nbsp;analysts!</p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="/__u/substackcdn.com/image/fetch/$s_!4uL0!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3dff95c2-a1e8-4990-b37b-fa8353548e47_1176x376.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="/__u/substackcdn.com/image/fetch/$s_!4uL0!, /__u/andrealeonel.substack.com/w_424, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3dff95c2-a1e8-4990-b37b-fa8353548e47_1176x376.png 424w, /__u/substackcdn.com/image/fetch/$s_!4uL0!, /__u/andrealeonel.substack.com/w_848, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3dff95c2-a1e8-4990-b37b-fa8353548e47_1176x376.png 848w, /__u/substackcdn.com/image/fetch/$s_!4uL0!, /__u/andrealeonel.substack.com/w_1272, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3dff95c2-a1e8-4990-b37b-fa8353548e47_1176x376.png 1272w, /__u/substackcdn.com/image/fetch/$s_!4uL0!, /__u/andrealeonel.substack.com/w_1456, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3dff95c2-a1e8-4990-b37b-fa8353548e47_1176x376.png 1456w" sizes="100vw"><img src="/__u/substackcdn.com/image/fetch/$s_!4uL0!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3dff95c2-a1e8-4990-b37b-fa8353548e47_1176x376.png" width="1176" height="376" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/3dff95c2-a1e8-4990-b37b-fa8353548e47_1176x376.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:376,&quot;width&quot;:1176,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:556867,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:&quot;https://andrealeonel.substack.com/i/180913983?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3dff95c2-a1e8-4990-b37b-fa8353548e47_1176x376.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="/__u/substackcdn.com/image/fetch/$s_!4uL0!, /__u/andrealeonel.substack.com/w_424, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3dff95c2-a1e8-4990-b37b-fa8353548e47_1176x376.png 424w, /__u/substackcdn.com/image/fetch/$s_!4uL0!, /__u/andrealeonel.substack.com/w_848, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3dff95c2-a1e8-4990-b37b-fa8353548e47_1176x376.png 848w, /__u/substackcdn.com/image/fetch/$s_!4uL0!, /__u/andrealeonel.substack.com/w_1272, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3dff95c2-a1e8-4990-b37b-fa8353548e47_1176x376.png 1272w, /__u/substackcdn.com/image/fetch/$s_!4uL0!, /__u/andrealeonel.substack.com/w_1456, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3dff95c2-a1e8-4990-b37b-fa8353548e47_1176x376.png 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>Yes, yet another part of the Practice Project Checkpoint 4! And it&#8217;s not the last one.</p><p>I just started a new job and the time I have available for this Study Guide has drastically shrunk. So, forgive me for the multiple parts. I&#8217;m just glad I&#8217;ve been able to stay consistent.</p><p>In Part 4, we&#8217;ll tackle Grants and Snapshots. Next part, hopefully the last one, we&#8217;ll add Exposures, Python models, and documentation to the project.</p><div><hr></div><h3>Grants</h3><p>For this Practice Project, we will define <a href="/__u/andrealeonel.substack.com/p/managing-access-permissions-with">grant permissions </a>in YAML files. </p><p>Let&#8217;s think of this scenario: we need to limit access to the &#8220;dim_employee&#8221; model as it shows confidential information on the employees.</p><p>Before we get started, it&#8217;s important to understand that each adapter will have specific <a href="https://docs.getdbt.com/reference/resource-configs/grants#database-specific-requirements-and-notes">terminology that needs to be used</a>. For instance, in Big Query, which is the adapter I am using, the &#8220;select&#8221; role is called &#8220;roles/bigquery.dataViewer&#8221;.</p><h4>Setting up grants</h4><p>We&#8217;ll first set up the grant config for the &#8220;dim_employee&#8221; model in the dbt_project.yml file. </p><p>Below, I gave a fictitious user permission to query my table in BigQuery.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="/__u/substackcdn.com/image/fetch/$s_!jNWW!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc7a80c48-288b-4631-bfc7-6386ff15777c_1330x342.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="/__u/substackcdn.com/image/fetch/$s_!jNWW!, /__u/andrealeonel.substack.com/w_424, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc7a80c48-288b-4631-bfc7-6386ff15777c_1330x342.png 424w, /__u/substackcdn.com/image/fetch/$s_!jNWW!, /__u/andrealeonel.substack.com/w_848, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc7a80c48-288b-4631-bfc7-6386ff15777c_1330x342.png 848w, /__u/substackcdn.com/image/fetch/$s_!jNWW!, /__u/andrealeonel.substack.com/w_1272, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc7a80c48-288b-4631-bfc7-6386ff15777c_1330x342.png 1272w, /__u/substackcdn.com/image/fetch/$s_!jNWW!, /__u/andrealeonel.substack.com/w_1456, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc7a80c48-288b-4631-bfc7-6386ff15777c_1330x342.png 1456w" sizes="100vw"><img src="/__u/substackcdn.com/image/fetch/$s_!jNWW!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc7a80c48-288b-4631-bfc7-6386ff15777c_1330x342.png" width="1330" height="342" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/c7a80c48-288b-4631-bfc7-6386ff15777c_1330x342.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:342,&quot;width&quot;:1330,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:33920,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://andrealeonel.substack.com/i/180913983?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc7a80c48-288b-4631-bfc7-6386ff15777c_1330x342.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="/__u/substackcdn.com/image/fetch/$s_!jNWW!, /__u/andrealeonel.substack.com/w_424, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc7a80c48-288b-4631-bfc7-6386ff15777c_1330x342.png 424w, /__u/substackcdn.com/image/fetch/$s_!jNWW!, /__u/andrealeonel.substack.com/w_848, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc7a80c48-288b-4631-bfc7-6386ff15777c_1330x342.png 848w, /__u/substackcdn.com/image/fetch/$s_!jNWW!, /__u/andrealeonel.substack.com/w_1272, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc7a80c48-288b-4631-bfc7-6386ff15777c_1330x342.png 1272w, /__u/substackcdn.com/image/fetch/$s_!jNWW!, /__u/andrealeonel.substack.com/w_1456, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc7a80c48-288b-4631-bfc7-6386ff15777c_1330x342.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption">Adding the grant config to the dbt_project.yml file.</figcaption></figure></div><h4>Conditional grant with Jinja</h4><p>We can also use Jinja to set conditional permissions. </p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="/__u/substackcdn.com/image/fetch/$s_!3-9m!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3baa6a84-37eb-4691-8523-1d6f83a44d77_1329x444.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="/__u/substackcdn.com/image/fetch/$s_!3-9m!, /__u/andrealeonel.substack.com/w_424, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3baa6a84-37eb-4691-8523-1d6f83a44d77_1329x444.png 424w, /__u/substackcdn.com/image/fetch/$s_!3-9m!, /__u/andrealeonel.substack.com/w_848, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3baa6a84-37eb-4691-8523-1d6f83a44d77_1329x444.png 848w, /__u/substackcdn.com/image/fetch/$s_!3-9m!, /__u/andrealeonel.substack.com/w_1272, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3baa6a84-37eb-4691-8523-1d6f83a44d77_1329x444.png 1272w, /__u/substackcdn.com/image/fetch/$s_!3-9m!, /__u/andrealeonel.substack.com/w_1456, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3baa6a84-37eb-4691-8523-1d6f83a44d77_1329x444.png 1456w" sizes="100vw"><img src="/__u/substackcdn.com/image/fetch/$s_!3-9m!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3baa6a84-37eb-4691-8523-1d6f83a44d77_1329x444.png" width="1329" height="444" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/3baa6a84-37eb-4691-8523-1d6f83a44d77_1329x444.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:444,&quot;width&quot;:1329,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:36976,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://andrealeonel.substack.com/i/180913983?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3baa6a84-37eb-4691-8523-1d6f83a44d77_1329x444.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="/__u/substackcdn.com/image/fetch/$s_!3-9m!, /__u/andrealeonel.substack.com/w_424, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3baa6a84-37eb-4691-8523-1d6f83a44d77_1329x444.png 424w, /__u/substackcdn.com/image/fetch/$s_!3-9m!, /__u/andrealeonel.substack.com/w_848, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3baa6a84-37eb-4691-8523-1d6f83a44d77_1329x444.png 848w, /__u/substackcdn.com/image/fetch/$s_!3-9m!, /__u/andrealeonel.substack.com/w_1272, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3baa6a84-37eb-4691-8523-1d6f83a44d77_1329x444.png 1272w, /__u/substackcdn.com/image/fetch/$s_!3-9m!, /__u/andrealeonel.substack.com/w_1456, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3baa6a84-37eb-4691-8523-1d6f83a44d77_1329x444.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>Even though the model was built successfully for both grants, when I queried the object privileges for &#8220;dim_employee&#8221; on BigQuery, I couldn&#8217;t get any data to return. I could not get this user to come up under my IAM permissions either. Not sure what this means, but I had to move on.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="/__u/substackcdn.com/image/fetch/$s_!VcI0!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff4012876-4ec8-4a70-82e7-65cc52bcc3ea_879x436.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="/__u/substackcdn.com/image/fetch/$s_!VcI0!, /__u/andrealeonel.substack.com/w_424, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff4012876-4ec8-4a70-82e7-65cc52bcc3ea_879x436.png 424w, /__u/substackcdn.com/image/fetch/$s_!VcI0!, /__u/andrealeonel.substack.com/w_848, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff4012876-4ec8-4a70-82e7-65cc52bcc3ea_879x436.png 848w, /__u/substackcdn.com/image/fetch/$s_!VcI0!, /__u/andrealeonel.substack.com/w_1272, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff4012876-4ec8-4a70-82e7-65cc52bcc3ea_879x436.png 1272w, /__u/substackcdn.com/image/fetch/$s_!VcI0!, /__u/andrealeonel.substack.com/w_1456, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff4012876-4ec8-4a70-82e7-65cc52bcc3ea_879x436.png 1456w" sizes="100vw"><img src="/__u/substackcdn.com/image/fetch/$s_!VcI0!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff4012876-4ec8-4a70-82e7-65cc52bcc3ea_879x436.png" width="879" height="436" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/f4012876-4ec8-4a70-82e7-65cc52bcc3ea_879x436.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:436,&quot;width&quot;:879,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:47025,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://andrealeonel.substack.com/i/180913983?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff4012876-4ec8-4a70-82e7-65cc52bcc3ea_879x436.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="/__u/substackcdn.com/image/fetch/$s_!VcI0!, /__u/andrealeonel.substack.com/w_424, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff4012876-4ec8-4a70-82e7-65cc52bcc3ea_879x436.png 424w, /__u/substackcdn.com/image/fetch/$s_!VcI0!, /__u/andrealeonel.substack.com/w_848, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff4012876-4ec8-4a70-82e7-65cc52bcc3ea_879x436.png 848w, /__u/substackcdn.com/image/fetch/$s_!VcI0!, /__u/andrealeonel.substack.com/w_1272, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff4012876-4ec8-4a70-82e7-65cc52bcc3ea_879x436.png 1272w, /__u/substackcdn.com/image/fetch/$s_!VcI0!, /__u/andrealeonel.substack.com/w_1456, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff4012876-4ec8-4a70-82e7-65cc52bcc3ea_879x436.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption">Querying object privileges on BigQuery returned no data, for some reason.</figcaption></figure></div><div><hr></div><h3>Snapshots</h3><p>We are using a dataset created by <a href="https://leo-godin.medium.com/learn-dbt-with-real-fake-data-68d6d21c3e8f">Leo Godin on Medium</a>, and I&#8217;m not entirely sure whether company or employee details change over time. </p><p>However, for the sake of our example, we are going to create 2 <a href="/__u/andrealeonel.substack.com/p/setting-up-and-maintaining-snapshots">Snapshots </a>to record changes to company and employee data.</p><p></p><h4>Adding live employee and company data</h4><p>First things first, we are going to connect our employee and company data to the live public database that Godin set up - so far, we&#8217;ve been keeping that data static. Don&#8217;t forget to run these models and their downstreams once done.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="/__u/substackcdn.com/image/fetch/$s_!Tmre!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fca9cd27c-2292-4ae3-9c5e-c380286a4c76_1321x418.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="/__u/substackcdn.com/image/fetch/$s_!Tmre!, /__u/andrealeonel.substack.com/w_424, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fca9cd27c-2292-4ae3-9c5e-c380286a4c76_1321x418.png 424w, /__u/substackcdn.com/image/fetch/$s_!Tmre!, /__u/andrealeonel.substack.com/w_848, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fca9cd27c-2292-4ae3-9c5e-c380286a4c76_1321x418.png 848w, /__u/substackcdn.com/image/fetch/$s_!Tmre!, /__u/andrealeonel.substack.com/w_1272, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fca9cd27c-2292-4ae3-9c5e-c380286a4c76_1321x418.png 1272w, /__u/substackcdn.com/image/fetch/$s_!Tmre!, /__u/andrealeonel.substack.com/w_1456, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fca9cd27c-2292-4ae3-9c5e-c380286a4c76_1321x418.png 1456w" sizes="100vw"><img src="/__u/substackcdn.com/image/fetch/$s_!Tmre!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fca9cd27c-2292-4ae3-9c5e-c380286a4c76_1321x418.png" width="1321" height="418" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/ca9cd27c-2292-4ae3-9c5e-c380286a4c76_1321x418.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:418,&quot;width&quot;:1321,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:48641,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://andrealeonel.substack.com/i/180913983?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fca9cd27c-2292-4ae3-9c5e-c380286a4c76_1321x418.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="/__u/substackcdn.com/image/fetch/$s_!Tmre!, /__u/andrealeonel.substack.com/w_424, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fca9cd27c-2292-4ae3-9c5e-c380286a4c76_1321x418.png 424w, /__u/substackcdn.com/image/fetch/$s_!Tmre!, /__u/andrealeonel.substack.com/w_848, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fca9cd27c-2292-4ae3-9c5e-c380286a4c76_1321x418.png 848w, /__u/substackcdn.com/image/fetch/$s_!Tmre!, /__u/andrealeonel.substack.com/w_1272, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fca9cd27c-2292-4ae3-9c5e-c380286a4c76_1321x418.png 1272w, /__u/substackcdn.com/image/fetch/$s_!Tmre!, /__u/andrealeonel.substack.com/w_1456, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fca9cd27c-2292-4ae3-9c5e-c380286a4c76_1321x418.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption">Adding <a href="https://leogodin217.github.io/dbt-fake/#!/model/model.dbt_fake_company.employees_base">Godin&#8217;s public tables</a> to our sources.</figcaption></figure></div><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="/__u/substackcdn.com/image/fetch/$s_!cMrl!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F10639bf0-686c-4b23-bef9-215eae529989_1299x424.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="/__u/substackcdn.com/image/fetch/$s_!cMrl!, /__u/andrealeonel.substack.com/w_424, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F10639bf0-686c-4b23-bef9-215eae529989_1299x424.png 424w, /__u/substackcdn.com/image/fetch/$s_!cMrl!, /__u/andrealeonel.substack.com/w_848, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F10639bf0-686c-4b23-bef9-215eae529989_1299x424.png 848w, /__u/substackcdn.com/image/fetch/$s_!cMrl!, /__u/andrealeonel.substack.com/w_1272, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F10639bf0-686c-4b23-bef9-215eae529989_1299x424.png 1272w, /__u/substackcdn.com/image/fetch/$s_!cMrl!, /__u/andrealeonel.substack.com/w_1456, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F10639bf0-686c-4b23-bef9-215eae529989_1299x424.png 1456w" sizes="100vw"><img src="/__u/substackcdn.com/image/fetch/$s_!cMrl!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F10639bf0-686c-4b23-bef9-215eae529989_1299x424.png" width="1299" height="424" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/10639bf0-686c-4b23-bef9-215eae529989_1299x424.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:424,&quot;width&quot;:1299,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:36922,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://andrealeonel.substack.com/i/180913983?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F10639bf0-686c-4b23-bef9-215eae529989_1299x424.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="/__u/substackcdn.com/image/fetch/$s_!cMrl!, /__u/andrealeonel.substack.com/w_424, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F10639bf0-686c-4b23-bef9-215eae529989_1299x424.png 424w, /__u/substackcdn.com/image/fetch/$s_!cMrl!, /__u/andrealeonel.substack.com/w_848, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F10639bf0-686c-4b23-bef9-215eae529989_1299x424.png 848w, /__u/substackcdn.com/image/fetch/$s_!cMrl!, /__u/andrealeonel.substack.com/w_1272, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F10639bf0-686c-4b23-bef9-215eae529989_1299x424.png 1272w, /__u/substackcdn.com/image/fetch/$s_!cMrl!, /__u/andrealeonel.substack.com/w_1456, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F10639bf0-686c-4b23-bef9-215eae529989_1299x424.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption">Updating our source table in the base_employees model.</figcaption></figure></div><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="/__u/substackcdn.com/image/fetch/$s_!QS4q!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F839cef34-f64b-47bf-b63e-b25ed7aa4101_1296x223.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="/__u/substackcdn.com/image/fetch/$s_!QS4q!, /__u/andrealeonel.substack.com/w_424, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F839cef34-f64b-47bf-b63e-b25ed7aa4101_1296x223.png 424w, /__u/substackcdn.com/image/fetch/$s_!QS4q!, /__u/andrealeonel.substack.com/w_848, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F839cef34-f64b-47bf-b63e-b25ed7aa4101_1296x223.png 848w, /__u/substackcdn.com/image/fetch/$s_!QS4q!, /__u/andrealeonel.substack.com/w_1272, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F839cef34-f64b-47bf-b63e-b25ed7aa4101_1296x223.png 1272w, /__u/substackcdn.com/image/fetch/$s_!QS4q!, /__u/andrealeonel.substack.com/w_1456, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F839cef34-f64b-47bf-b63e-b25ed7aa4101_1296x223.png 1456w" sizes="100vw"><img src="/__u/substackcdn.com/image/fetch/$s_!QS4q!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F839cef34-f64b-47bf-b63e-b25ed7aa4101_1296x223.png" width="1296" height="223" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/839cef34-f64b-47bf-b63e-b25ed7aa4101_1296x223.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:223,&quot;width&quot;:1296,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:22935,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://andrealeonel.substack.com/i/180913983?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F839cef34-f64b-47bf-b63e-b25ed7aa4101_1296x223.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="/__u/substackcdn.com/image/fetch/$s_!QS4q!, /__u/andrealeonel.substack.com/w_424, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F839cef34-f64b-47bf-b63e-b25ed7aa4101_1296x223.png 424w, /__u/substackcdn.com/image/fetch/$s_!QS4q!, /__u/andrealeonel.substack.com/w_848, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F839cef34-f64b-47bf-b63e-b25ed7aa4101_1296x223.png 848w, /__u/substackcdn.com/image/fetch/$s_!QS4q!, /__u/andrealeonel.substack.com/w_1272, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F839cef34-f64b-47bf-b63e-b25ed7aa4101_1296x223.png 1272w, /__u/substackcdn.com/image/fetch/$s_!QS4q!, /__u/andrealeonel.substack.com/w_1456, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F839cef34-f64b-47bf-b63e-b25ed7aa4101_1296x223.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a><figcaption class="image-caption">Updating our source table for the stg_companies model.</figcaption></figure></div><h4>Defining Snapshot strategy</h4><p>We don&#8217;t have an &#8220;updated_at&#8221; field we can go by in our data, so we&#8217;ll adopt the &#8220;check&#8221; strategy.</p><p>It is recommended to store your snapshots in a different schema, as once dropped, you cannot recover the historical changes lost. So we will define it to be built in our prod schema.</p><p>Also, dbt recommends basing snapshots on staging models that have already been cleaned rather than the raw data.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="/__u/substackcdn.com/image/fetch/$s_!qPxt!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F864dfff1-fcb8-41fa-9950-6b9f363135dd_1332x664.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="/__u/substackcdn.com/image/fetch/$s_!qPxt!, /__u/andrealeonel.substack.com/w_424, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F864dfff1-fcb8-41fa-9950-6b9f363135dd_1332x664.png 424w, /__u/substackcdn.com/image/fetch/$s_!qPxt!, /__u/andrealeonel.substack.com/w_848, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F864dfff1-fcb8-41fa-9950-6b9f363135dd_1332x664.png 848w, /__u/substackcdn.com/image/fetch/$s_!qPxt!, /__u/andrealeonel.substack.com/w_1272, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F864dfff1-fcb8-41fa-9950-6b9f363135dd_1332x664.png 1272w, /__u/substackcdn.com/image/fetch/$s_!qPxt!, /__u/andrealeonel.substack.com/w_1456, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F864dfff1-fcb8-41fa-9950-6b9f363135dd_1332x664.png 1456w" sizes="100vw"><img src="/__u/substackcdn.com/image/fetch/$s_!qPxt!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F864dfff1-fcb8-41fa-9950-6b9f363135dd_1332x664.png" width="1332" height="664" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/864dfff1-fcb8-41fa-9950-6b9f363135dd_1332x664.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:664,&quot;width&quot;:1332,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:93754,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://andrealeonel.substack.com/i/180913983?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F864dfff1-fcb8-41fa-9950-6b9f363135dd_1332x664.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="/__u/substackcdn.com/image/fetch/$s_!qPxt!, /__u/andrealeonel.substack.com/w_424, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F864dfff1-fcb8-41fa-9950-6b9f363135dd_1332x664.png 424w, /__u/substackcdn.com/image/fetch/$s_!qPxt!, /__u/andrealeonel.substack.com/w_848, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F864dfff1-fcb8-41fa-9950-6b9f363135dd_1332x664.png 848w, /__u/substackcdn.com/image/fetch/$s_!qPxt!, /__u/andrealeonel.substack.com/w_1272, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F864dfff1-fcb8-41fa-9950-6b9f363135dd_1332x664.png 1272w, /__u/substackcdn.com/image/fetch/$s_!qPxt!, /__u/andrealeonel.substack.com/w_1456, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F864dfff1-fcb8-41fa-9950-6b9f363135dd_1332x664.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption">My configurations for the 2 Snapshots</figcaption></figure></div><p>Run the &#8220;dbt snapshot&#8221; command and check that the two tables were created on dbt and in the warehouse.</p><h4>Verifying Snapshots</h4><p>Upon running the command, you will see the tables being created in the warehouse. On the first run, dbt simply copies the existing records and adds accessory columns like &#8220;dbt_scd_id&#8221;, &#8220;dbt_updated_at&#8221;, and &#8220;dbt_valid_from&#8221;.</p><p>Upon subsequent runs, dbt will check which records have changed or if any new records have been created. The updated record and any new records will be inserted into the snapshot table.</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="/__u/substackcdn.com/image/fetch/$s_!v86L!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F38497ddd-34ec-4ed3-8a04-e4bc04c5949e_1546x346.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="/__u/substackcdn.com/image/fetch/$s_!v86L!, /__u/andrealeonel.substack.com/w_424, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F38497ddd-34ec-4ed3-8a04-e4bc04c5949e_1546x346.png 424w, /__u/substackcdn.com/image/fetch/$s_!v86L!, /__u/andrealeonel.substack.com/w_848, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F38497ddd-34ec-4ed3-8a04-e4bc04c5949e_1546x346.png 848w, /__u/substackcdn.com/image/fetch/$s_!v86L!, /__u/andrealeonel.substack.com/w_1272, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F38497ddd-34ec-4ed3-8a04-e4bc04c5949e_1546x346.png 1272w, /__u/substackcdn.com/image/fetch/$s_!v86L!, /__u/andrealeonel.substack.com/w_1456, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F38497ddd-34ec-4ed3-8a04-e4bc04c5949e_1546x346.png 1456w" sizes="100vw"><img src="/__u/substackcdn.com/image/fetch/$s_!v86L!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F38497ddd-34ec-4ed3-8a04-e4bc04c5949e_1546x346.png" width="1456" height="326" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/38497ddd-34ec-4ed3-8a04-e4bc04c5949e_1546x346.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:326,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:183137,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://andrealeonel.substack.com/i/180913983?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F38497ddd-34ec-4ed3-8a04-e4bc04c5949e_1546x346.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="/__u/substackcdn.com/image/fetch/$s_!v86L!, /__u/andrealeonel.substack.com/w_424, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F38497ddd-34ec-4ed3-8a04-e4bc04c5949e_1546x346.png 424w, /__u/substackcdn.com/image/fetch/$s_!v86L!, /__u/andrealeonel.substack.com/w_848, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F38497ddd-34ec-4ed3-8a04-e4bc04c5949e_1546x346.png 848w, /__u/substackcdn.com/image/fetch/$s_!v86L!, /__u/andrealeonel.substack.com/w_1272, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F38497ddd-34ec-4ed3-8a04-e4bc04c5949e_1546x346.png 1272w, /__u/substackcdn.com/image/fetch/$s_!v86L!, /__u/andrealeonel.substack.com/w_1456, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F38497ddd-34ec-4ed3-8a04-e4bc04c5949e_1546x346.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a><figcaption class="image-caption">Companies snapshot shown in BigQuery.</figcaption></figure></div><h4>Frequent jobs for Snapshots</h4><p>In a real-life scenario, you&#8217;d need to have a frequent, scheduled job to run the snapshots to ensure you&#8217;re capturing all changes. </p><p>In my case, since I don&#8217;t have billing enabled on BigQuery, the Snapshots wouldn&#8217;t quite work the way they&#8217;re supposed to, so I&#8217;ll skip this step for this Practice Project.</p>]]></content:encoded></item><item><title><![CDATA[Practice Project 8: model governance]]></title><description><![CDATA[Adding model governance features to our project - and failing miserably at Model Versioning.]]></description><link>https://andrealeonel.substack.com/p/practice-project-checkpoint-4-part-aed</link><guid isPermaLink="false">https://andrealeonel.substack.com/p/practice-project-checkpoint-4-part-aed</guid><dc:creator><![CDATA[Andrea Leonel]]></dc:creator><pubDate>Sun, 30 Nov 2025 16:11:24 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!SZI5!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4f2d4e61-f7ac-4b74-a54f-a5fb7e7655c0_1177x358.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p><em>Part of the <a href="/__u/andrealeonel.substack.com/p/study-for-the-dbt-analytics-engineering">&#8220;Mastering dbt&#8221;</a> series. Access to the full <a href="/__u/andrealeonel.substack.com/p/dbt-analytics-engineering-certification">Study Guide</a>. Let&#8217;s connect on <a href="https://www.linkedin.com/in/andrealeonel/">LinkedIn</a>!</em></p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://andrealeonel.substack.com/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption">Join hundreds of aspiring dbt developers &amp; data&nbsp;analysts!</p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="/__u/substackcdn.com/image/fetch/$s_!SZI5!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4f2d4e61-f7ac-4b74-a54f-a5fb7e7655c0_1177x358.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="/__u/substackcdn.com/image/fetch/$s_!SZI5!, /__u/andrealeonel.substack.com/w_424, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4f2d4e61-f7ac-4b74-a54f-a5fb7e7655c0_1177x358.png 424w, /__u/substackcdn.com/image/fetch/$s_!SZI5!, /__u/andrealeonel.substack.com/w_848, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4f2d4e61-f7ac-4b74-a54f-a5fb7e7655c0_1177x358.png 848w, /__u/substackcdn.com/image/fetch/$s_!SZI5!, /__u/andrealeonel.substack.com/w_1272, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4f2d4e61-f7ac-4b74-a54f-a5fb7e7655c0_1177x358.png 1272w, /__u/substackcdn.com/image/fetch/$s_!SZI5!, /__u/andrealeonel.substack.com/w_1456, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4f2d4e61-f7ac-4b74-a54f-a5fb7e7655c0_1177x358.png 1456w" sizes="100vw"><img src="/__u/substackcdn.com/image/fetch/$s_!SZI5!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4f2d4e61-f7ac-4b74-a54f-a5fb7e7655c0_1177x358.png" width="1177" height="358" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/4f2d4e61-f7ac-4b74-a54f-a5fb7e7655c0_1177x358.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:358,&quot;width&quot;:1177,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:530503,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:&quot;https://andrealeonel.substack.com/i/180279999?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4f2d4e61-f7ac-4b74-a54f-a5fb7e7655c0_1177x358.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="/__u/substackcdn.com/image/fetch/$s_!SZI5!, /__u/andrealeonel.substack.com/w_424, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4f2d4e61-f7ac-4b74-a54f-a5fb7e7655c0_1177x358.png 424w, /__u/substackcdn.com/image/fetch/$s_!SZI5!, /__u/andrealeonel.substack.com/w_848, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4f2d4e61-f7ac-4b74-a54f-a5fb7e7655c0_1177x358.png 848w, /__u/substackcdn.com/image/fetch/$s_!SZI5!, /__u/andrealeonel.substack.com/w_1272, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4f2d4e61-f7ac-4b74-a54f-a5fb7e7655c0_1177x358.png 1272w, /__u/substackcdn.com/image/fetch/$s_!SZI5!, /__u/andrealeonel.substack.com/w_1456, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4f2d4e61-f7ac-4b74-a54f-a5fb7e7655c0_1177x358.png 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>Some configurations look straightforward in the documentation but when you actually try to implement them in a complex project, you run into all sorts of bugs.</p><p>This was the case with Model Governance features. I had some trouble setting up the access modifier correctly and, unfortunately, could not implement model versioning (I explained the bugs below).</p><p>This goes to show the importance of practising. Running into bugs is very frustrating, but they help us really grasp the workings behind dbt.</p><div><hr></div><h3>Model Governance</h3><p>For this practice step, we will add some <a href="/__u/andrealeonel.substack.com/p/model-governance-access-contracts">model governance features </a>to our project.</p><p>Here, we will add all features for practice, but in a real-life scenario, you would only add these features as needed. In data modelling, we always strive to reduce unnecessary complexity.</p><h4>Model access</h4><p>This is the ability to make models public or private to control who can ref them.</p><p>First, we need to define a group. We already have some groups defined by department, like the &#8220;customer_success&#8221; group, which holds the &#8220;fct_company&#8221; and &#8220;fct_company_trend&#8221; models. </p><p>By default, all groups are protected, so let&#8217;s change this group to private and try to ref one of its models from outside the group.</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="/__u/substackcdn.com/image/fetch/$s_!BGij!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcc15ca3e-36d2-4801-ab95-cfb0391b0de7_1209x289.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="/__u/substackcdn.com/image/fetch/$s_!BGij!, /__u/andrealeonel.substack.com/w_424, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcc15ca3e-36d2-4801-ab95-cfb0391b0de7_1209x289.png 424w, /__u/substackcdn.com/image/fetch/$s_!BGij!, /__u/andrealeonel.substack.com/w_848, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcc15ca3e-36d2-4801-ab95-cfb0391b0de7_1209x289.png 848w, /__u/substackcdn.com/image/fetch/$s_!BGij!, /__u/andrealeonel.substack.com/w_1272, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcc15ca3e-36d2-4801-ab95-cfb0391b0de7_1209x289.png 1272w, /__u/substackcdn.com/image/fetch/$s_!BGij!, /__u/andrealeonel.substack.com/w_1456, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcc15ca3e-36d2-4801-ab95-cfb0391b0de7_1209x289.png 1456w" sizes="100vw"><img src="/__u/substackcdn.com/image/fetch/$s_!BGij!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcc15ca3e-36d2-4801-ab95-cfb0391b0de7_1209x289.png" width="1209" height="289" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/cc15ca3e-36d2-4801-ab95-cfb0391b0de7_1209x289.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:289,&quot;width&quot;:1209,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:32290,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://andrealeonel.substack.com/i/180279999?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcc15ca3e-36d2-4801-ab95-cfb0391b0de7_1209x289.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="/__u/substackcdn.com/image/fetch/$s_!BGij!, /__u/andrealeonel.substack.com/w_424, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcc15ca3e-36d2-4801-ab95-cfb0391b0de7_1209x289.png 424w, /__u/substackcdn.com/image/fetch/$s_!BGij!, /__u/andrealeonel.substack.com/w_848, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcc15ca3e-36d2-4801-ab95-cfb0391b0de7_1209x289.png 848w, /__u/substackcdn.com/image/fetch/$s_!BGij!, /__u/andrealeonel.substack.com/w_1272, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcc15ca3e-36d2-4801-ab95-cfb0391b0de7_1209x289.png 1272w, /__u/substackcdn.com/image/fetch/$s_!BGij!, /__u/andrealeonel.substack.com/w_1456, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcc15ca3e-36d2-4801-ab95-cfb0391b0de7_1209x289.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a><figcaption class="image-caption">Setting up the group and access in the bt_project.yml file.</figcaption></figure></div><p>I then created a new model and tried to reference one of the models. Upon compiling, I got the expected error.</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="/__u/substackcdn.com/image/fetch/$s_!XOMz!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5395461b-9dc0-4d28-9698-2ff86a5a8d39_1471x181.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="/__u/substackcdn.com/image/fetch/$s_!XOMz!, /__u/andrealeonel.substack.com/w_424, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5395461b-9dc0-4d28-9698-2ff86a5a8d39_1471x181.png 424w, /__u/substackcdn.com/image/fetch/$s_!XOMz!, /__u/andrealeonel.substack.com/w_848, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5395461b-9dc0-4d28-9698-2ff86a5a8d39_1471x181.png 848w, /__u/substackcdn.com/image/fetch/$s_!XOMz!, /__u/andrealeonel.substack.com/w_1272, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5395461b-9dc0-4d28-9698-2ff86a5a8d39_1471x181.png 1272w, /__u/substackcdn.com/image/fetch/$s_!XOMz!, /__u/andrealeonel.substack.com/w_1456, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5395461b-9dc0-4d28-9698-2ff86a5a8d39_1471x181.png 1456w" sizes="100vw"><img src="/__u/substackcdn.com/image/fetch/$s_!XOMz!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5395461b-9dc0-4d28-9698-2ff86a5a8d39_1471x181.png" width="1456" height="179" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/5395461b-9dc0-4d28-9698-2ff86a5a8d39_1471x181.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:179,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:29719,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://andrealeonel.substack.com/i/180279999?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5395461b-9dc0-4d28-9698-2ff86a5a8d39_1471x181.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="/__u/substackcdn.com/image/fetch/$s_!XOMz!, /__u/andrealeonel.substack.com/w_424, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5395461b-9dc0-4d28-9698-2ff86a5a8d39_1471x181.png 424w, /__u/substackcdn.com/image/fetch/$s_!XOMz!, /__u/andrealeonel.substack.com/w_848, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5395461b-9dc0-4d28-9698-2ff86a5a8d39_1471x181.png 848w, /__u/substackcdn.com/image/fetch/$s_!XOMz!, /__u/andrealeonel.substack.com/w_1272, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5395461b-9dc0-4d28-9698-2ff86a5a8d39_1471x181.png 1272w, /__u/substackcdn.com/image/fetch/$s_!XOMz!, /__u/andrealeonel.substack.com/w_1456, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5395461b-9dc0-4d28-9698-2ff86a5a8d39_1471x181.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><h4>Model contracts</h4><p>They restrict the shape of a model in terms of column names, data types, and constraints.</p><p>Following dbt&#8217;s recommendation, we will enforce some contracts in our fact tables. For instance, fct_orders could use some contracts, as we started feeding it with live data in the <a href="/__u/andrealeonel.substack.com/p/practice-project-checkpoint-4-part-c38">Practice Project 4 - Step 2</a>.</p><p>Firstly, let&#8217;s add the contract and constraints to the dbt_project.yml file. Please note that I&#8217;m using BigQuery and, while it enforces schema contracts, it doesn&#8217;t enforce constraints.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="/__u/substackcdn.com/image/fetch/$s_!TLDX!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff4ff8b43-4d0c-4fc6-9155-1274cba31f4e_1324x811.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="/__u/substackcdn.com/image/fetch/$s_!TLDX!, /__u/andrealeonel.substack.com/w_424, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff4ff8b43-4d0c-4fc6-9155-1274cba31f4e_1324x811.png 424w, /__u/substackcdn.com/image/fetch/$s_!TLDX!, /__u/andrealeonel.substack.com/w_848, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff4ff8b43-4d0c-4fc6-9155-1274cba31f4e_1324x811.png 848w, /__u/substackcdn.com/image/fetch/$s_!TLDX!, /__u/andrealeonel.substack.com/w_1272, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff4ff8b43-4d0c-4fc6-9155-1274cba31f4e_1324x811.png 1272w, /__u/substackcdn.com/image/fetch/$s_!TLDX!, /__u/andrealeonel.substack.com/w_1456, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff4ff8b43-4d0c-4fc6-9155-1274cba31f4e_1324x811.png 1456w" sizes="100vw"><img src="/__u/substackcdn.com/image/fetch/$s_!TLDX!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff4ff8b43-4d0c-4fc6-9155-1274cba31f4e_1324x811.png" width="1324" height="811" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/f4ff8b43-4d0c-4fc6-9155-1274cba31f4e_1324x811.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:811,&quot;width&quot;:1324,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:103735,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://andrealeonel.substack.com/i/180279999?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff4ff8b43-4d0c-4fc6-9155-1274cba31f4e_1324x811.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="/__u/substackcdn.com/image/fetch/$s_!TLDX!, /__u/andrealeonel.substack.com/w_424, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff4ff8b43-4d0c-4fc6-9155-1274cba31f4e_1324x811.png 424w, /__u/substackcdn.com/image/fetch/$s_!TLDX!, /__u/andrealeonel.substack.com/w_848, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff4ff8b43-4d0c-4fc6-9155-1274cba31f4e_1324x811.png 848w, /__u/substackcdn.com/image/fetch/$s_!TLDX!, /__u/andrealeonel.substack.com/w_1272, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff4ff8b43-4d0c-4fc6-9155-1274cba31f4e_1324x811.png 1272w, /__u/substackcdn.com/image/fetch/$s_!TLDX!, /__u/andrealeonel.substack.com/w_1456, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff4ff8b43-4d0c-4fc6-9155-1274cba31f4e_1324x811.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption">Adding contract and constraints to the properties.yml file.</figcaption></figure></div><p>I modified the fct_orders table by selecting only two of its columns to see it fail. </p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="/__u/substackcdn.com/image/fetch/$s_!pNbz!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa51d2055-b925-4fc0-b079-77ced99446c1_1317x205.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="/__u/substackcdn.com/image/fetch/$s_!pNbz!, /__u/andrealeonel.substack.com/w_424, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa51d2055-b925-4fc0-b079-77ced99446c1_1317x205.png 424w, /__u/substackcdn.com/image/fetch/$s_!pNbz!, /__u/andrealeonel.substack.com/w_848, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa51d2055-b925-4fc0-b079-77ced99446c1_1317x205.png 848w, /__u/substackcdn.com/image/fetch/$s_!pNbz!, /__u/andrealeonel.substack.com/w_1272, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa51d2055-b925-4fc0-b079-77ced99446c1_1317x205.png 1272w, /__u/substackcdn.com/image/fetch/$s_!pNbz!, /__u/andrealeonel.substack.com/w_1456, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa51d2055-b925-4fc0-b079-77ced99446c1_1317x205.png 1456w" sizes="100vw"><img src="/__u/substackcdn.com/image/fetch/$s_!pNbz!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa51d2055-b925-4fc0-b079-77ced99446c1_1317x205.png" width="1317" height="205" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/a51d2055-b925-4fc0-b079-77ced99446c1_1317x205.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:205,&quot;width&quot;:1317,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:24097,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://andrealeonel.substack.com/i/180279999?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa51d2055-b925-4fc0-b079-77ced99446c1_1317x205.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="/__u/substackcdn.com/image/fetch/$s_!pNbz!, /__u/andrealeonel.substack.com/w_424, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa51d2055-b925-4fc0-b079-77ced99446c1_1317x205.png 424w, /__u/substackcdn.com/image/fetch/$s_!pNbz!, /__u/andrealeonel.substack.com/w_848, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa51d2055-b925-4fc0-b079-77ced99446c1_1317x205.png 848w, /__u/substackcdn.com/image/fetch/$s_!pNbz!, /__u/andrealeonel.substack.com/w_1272, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa51d2055-b925-4fc0-b079-77ced99446c1_1317x205.png 1272w, /__u/substackcdn.com/image/fetch/$s_!pNbz!, /__u/andrealeonel.substack.com/w_1456, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa51d2055-b925-4fc0-b079-77ced99446c1_1317x205.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a><figcaption class="image-caption">Attempting to enforce a schema contract fail for fct_orders.</figcaption></figure></div><p>Upon building the model, I get the model contract error:</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="/__u/substackcdn.com/image/fetch/$s_!KSVc!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F95e1fc15-d356-4197-af76-4214875203e9_1107x654.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="/__u/substackcdn.com/image/fetch/$s_!KSVc!, /__u/andrealeonel.substack.com/w_424, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F95e1fc15-d356-4197-af76-4214875203e9_1107x654.png 424w, /__u/substackcdn.com/image/fetch/$s_!KSVc!, /__u/andrealeonel.substack.com/w_848, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F95e1fc15-d356-4197-af76-4214875203e9_1107x654.png 848w, /__u/substackcdn.com/image/fetch/$s_!KSVc!, /__u/andrealeonel.substack.com/w_1272, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F95e1fc15-d356-4197-af76-4214875203e9_1107x654.png 1272w, /__u/substackcdn.com/image/fetch/$s_!KSVc!, /__u/andrealeonel.substack.com/w_1456, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F95e1fc15-d356-4197-af76-4214875203e9_1107x654.png 1456w" sizes="100vw"><img src="/__u/substackcdn.com/image/fetch/$s_!KSVc!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F95e1fc15-d356-4197-af76-4214875203e9_1107x654.png" width="1107" height="654" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/95e1fc15-d356-4197-af76-4214875203e9_1107x654.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:654,&quot;width&quot;:1107,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:79116,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://andrealeonel.substack.com/i/180279999?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F95e1fc15-d356-4197-af76-4214875203e9_1107x654.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="/__u/substackcdn.com/image/fetch/$s_!KSVc!, /__u/andrealeonel.substack.com/w_424, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F95e1fc15-d356-4197-af76-4214875203e9_1107x654.png 424w, /__u/substackcdn.com/image/fetch/$s_!KSVc!, /__u/andrealeonel.substack.com/w_848, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F95e1fc15-d356-4197-af76-4214875203e9_1107x654.png 848w, /__u/substackcdn.com/image/fetch/$s_!KSVc!, /__u/andrealeonel.substack.com/w_1272, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F95e1fc15-d356-4197-af76-4214875203e9_1107x654.png 1272w, /__u/substackcdn.com/image/fetch/$s_!KSVc!, /__u/andrealeonel.substack.com/w_1456, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F95e1fc15-d356-4197-af76-4214875203e9_1107x654.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption">Logs showing me the columns missing from the contract.</figcaption></figure></div><h4>Model namespaces</h4><p>Delineate ownership boundaries and responsibilities through naming structures.</p><p>We&#8217;ve been working with namespaces throughout the Practice Project. For instance, when we added groups and access modifiers to the customer_success subdirectories above, we were using namespaces.</p><p>Also, when we use the source function, we are declaring the source namespace. In the example below, it would be &#8220;dbt_fake_live&#8221;.</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="/__u/substackcdn.com/image/fetch/$s_!1tzx!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9a0fd143-f84c-4bea-ba07-1d59a89c03d6_1285x211.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="/__u/substackcdn.com/image/fetch/$s_!1tzx!, /__u/andrealeonel.substack.com/w_424, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9a0fd143-f84c-4bea-ba07-1d59a89c03d6_1285x211.png 424w, /__u/substackcdn.com/image/fetch/$s_!1tzx!, /__u/andrealeonel.substack.com/w_848, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9a0fd143-f84c-4bea-ba07-1d59a89c03d6_1285x211.png 848w, /__u/substackcdn.com/image/fetch/$s_!1tzx!, /__u/andrealeonel.substack.com/w_1272, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9a0fd143-f84c-4bea-ba07-1d59a89c03d6_1285x211.png 1272w, /__u/substackcdn.com/image/fetch/$s_!1tzx!, /__u/andrealeonel.substack.com/w_1456, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9a0fd143-f84c-4bea-ba07-1d59a89c03d6_1285x211.png 1456w" sizes="100vw"><img src="/__u/substackcdn.com/image/fetch/$s_!1tzx!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9a0fd143-f84c-4bea-ba07-1d59a89c03d6_1285x211.png" width="1285" height="211" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/9a0fd143-f84c-4bea-ba07-1d59a89c03d6_1285x211.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:211,&quot;width&quot;:1285,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:20955,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://andrealeonel.substack.com/i/180279999?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9a0fd143-f84c-4bea-ba07-1d59a89c03d6_1285x211.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="/__u/substackcdn.com/image/fetch/$s_!1tzx!, /__u/andrealeonel.substack.com/w_424, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9a0fd143-f84c-4bea-ba07-1d59a89c03d6_1285x211.png 424w, /__u/substackcdn.com/image/fetch/$s_!1tzx!, /__u/andrealeonel.substack.com/w_848, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9a0fd143-f84c-4bea-ba07-1d59a89c03d6_1285x211.png 848w, /__u/substackcdn.com/image/fetch/$s_!1tzx!, /__u/andrealeonel.substack.com/w_1272, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9a0fd143-f84c-4bea-ba07-1d59a89c03d6_1285x211.png 1272w, /__u/substackcdn.com/image/fetch/$s_!1tzx!, /__u/andrealeonel.substack.com/w_1456, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9a0fd143-f84c-4bea-ba07-1d59a89c03d6_1285x211.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a><figcaption class="image-caption">Namespaces in action within the source function.</figcaption></figure></div><h4>Model versions</h4><p>Versioning for the models, allowing for adjustments to be made without breaking access for the end user.</p><p>Now, for this one, I must be honest: I could not get it to work.</p><p>I tried versioning fct_orders and set up the configuration as per the documentation. However, dbt refused to read &#8220;fct_orders&#8221; as the v1 model. I tried using the defined_in optional parameter, renaming fct_orders to fct_orders_v1. Nothing worked.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="/__u/substackcdn.com/image/fetch/$s_!6en_!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe289297c-709d-4bae-985a-90ed5a53ae11_1338x576.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="/__u/substackcdn.com/image/fetch/$s_!6en_!, /__u/andrealeonel.substack.com/w_424, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe289297c-709d-4bae-985a-90ed5a53ae11_1338x576.png 424w, /__u/substackcdn.com/image/fetch/$s_!6en_!, /__u/andrealeonel.substack.com/w_848, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe289297c-709d-4bae-985a-90ed5a53ae11_1338x576.png 848w, /__u/substackcdn.com/image/fetch/$s_!6en_!, /__u/andrealeonel.substack.com/w_1272, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe289297c-709d-4bae-985a-90ed5a53ae11_1338x576.png 1272w, /__u/substackcdn.com/image/fetch/$s_!6en_!, /__u/andrealeonel.substack.com/w_1456, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe289297c-709d-4bae-985a-90ed5a53ae11_1338x576.png 1456w" sizes="100vw"><img src="/__u/substackcdn.com/image/fetch/$s_!6en_!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe289297c-709d-4bae-985a-90ed5a53ae11_1338x576.png" width="1338" height="576" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/e289297c-709d-4bae-985a-90ed5a53ae11_1338x576.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:576,&quot;width&quot;:1338,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:62008,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://andrealeonel.substack.com/i/180279999?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe289297c-709d-4bae-985a-90ed5a53ae11_1338x576.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="/__u/substackcdn.com/image/fetch/$s_!6en_!, /__u/andrealeonel.substack.com/w_424, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe289297c-709d-4bae-985a-90ed5a53ae11_1338x576.png 424w, /__u/substackcdn.com/image/fetch/$s_!6en_!, /__u/andrealeonel.substack.com/w_848, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe289297c-709d-4bae-985a-90ed5a53ae11_1338x576.png 848w, /__u/substackcdn.com/image/fetch/$s_!6en_!, /__u/andrealeonel.substack.com/w_1272, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe289297c-709d-4bae-985a-90ed5a53ae11_1338x576.png 1272w, /__u/substackcdn.com/image/fetch/$s_!6en_!, /__u/andrealeonel.substack.com/w_1456, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe289297c-709d-4bae-985a-90ed5a53ae11_1338x576.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption">My properties file with the versions: configuration. I tried it without the defined_in parameter too, but no luck. This file was in the correct directory and fct_orders was not declared anywhere else.</figcaption></figure></div><p>Upon trying to compile the v1 (dbt compile -s fct_orders:v1), dbt seemed to see two &#8220;fct_orders&#8221; models, one versioned and one unversioned.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="/__u/substackcdn.com/image/fetch/$s_!5Vtv!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffdcbfb9f-666c-442a-bbe6-f25f7da5b85e_1141x334.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="/__u/substackcdn.com/image/fetch/$s_!5Vtv!, /__u/andrealeonel.substack.com/w_424, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffdcbfb9f-666c-442a-bbe6-f25f7da5b85e_1141x334.png 424w, /__u/substackcdn.com/image/fetch/$s_!5Vtv!, /__u/andrealeonel.substack.com/w_848, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffdcbfb9f-666c-442a-bbe6-f25f7da5b85e_1141x334.png 848w, /__u/substackcdn.com/image/fetch/$s_!5Vtv!, /__u/andrealeonel.substack.com/w_1272, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffdcbfb9f-666c-442a-bbe6-f25f7da5b85e_1141x334.png 1272w, /__u/substackcdn.com/image/fetch/$s_!5Vtv!, /__u/andrealeonel.substack.com/w_1456, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffdcbfb9f-666c-442a-bbe6-f25f7da5b85e_1141x334.png 1456w" sizes="100vw"><img src="/__u/substackcdn.com/image/fetch/$s_!5Vtv!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffdcbfb9f-666c-442a-bbe6-f25f7da5b85e_1141x334.png" width="1141" height="334" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/fdcbfb9f-666c-442a-bbe6-f25f7da5b85e_1141x334.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:334,&quot;width&quot;:1141,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:39851,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://andrealeonel.substack.com/i/180279999?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffdcbfb9f-666c-442a-bbe6-f25f7da5b85e_1141x334.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="/__u/substackcdn.com/image/fetch/$s_!5Vtv!, /__u/andrealeonel.substack.com/w_424, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffdcbfb9f-666c-442a-bbe6-f25f7da5b85e_1141x334.png 424w, /__u/substackcdn.com/image/fetch/$s_!5Vtv!, /__u/andrealeonel.substack.com/w_848, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffdcbfb9f-666c-442a-bbe6-f25f7da5b85e_1141x334.png 848w, /__u/substackcdn.com/image/fetch/$s_!5Vtv!, /__u/andrealeonel.substack.com/w_1272, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffdcbfb9f-666c-442a-bbe6-f25f7da5b85e_1141x334.png 1272w, /__u/substackcdn.com/image/fetch/$s_!5Vtv!, /__u/andrealeonel.substack.com/w_1456, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffdcbfb9f-666c-442a-bbe6-f25f7da5b85e_1141x334.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption">The error upon trying to compile the v1 version dbt compile -s fct_orders:v1. There was definitely only one fct_orders model and it was declared only once.</figcaption></figure></div><p>Also, interestingly, as soon as I created the fct_orders_v2 file, I got a server status error. But when I edited the file name to fct_orders__v2 (with double underscore), the server status went back to Ready. Go figure.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="/__u/substackcdn.com/image/fetch/$s_!Pppr!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdf57e444-60c6-4451-9bd1-b06c6363bc6f_667x430.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="/__u/substackcdn.com/image/fetch/$s_!Pppr!, /__u/andrealeonel.substack.com/w_424, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdf57e444-60c6-4451-9bd1-b06c6363bc6f_667x430.png 424w, /__u/substackcdn.com/image/fetch/$s_!Pppr!, /__u/andrealeonel.substack.com/w_848, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdf57e444-60c6-4451-9bd1-b06c6363bc6f_667x430.png 848w, /__u/substackcdn.com/image/fetch/$s_!Pppr!, /__u/andrealeonel.substack.com/w_1272, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdf57e444-60c6-4451-9bd1-b06c6363bc6f_667x430.png 1272w, /__u/substackcdn.com/image/fetch/$s_!Pppr!, /__u/andrealeonel.substack.com/w_1456, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdf57e444-60c6-4451-9bd1-b06c6363bc6f_667x430.png 1456w" sizes="100vw"><img src="/__u/substackcdn.com/image/fetch/$s_!Pppr!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdf57e444-60c6-4451-9bd1-b06c6363bc6f_667x430.png" width="667" height="430" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/df57e444-60c6-4451-9bd1-b06c6363bc6f_667x430.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:430,&quot;width&quot;:667,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:39236,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://andrealeonel.substack.com/i/180279999?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdf57e444-60c6-4451-9bd1-b06c6363bc6f_667x430.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="/__u/substackcdn.com/image/fetch/$s_!Pppr!, /__u/andrealeonel.substack.com/w_424, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdf57e444-60c6-4451-9bd1-b06c6363bc6f_667x430.png 424w, /__u/substackcdn.com/image/fetch/$s_!Pppr!, /__u/andrealeonel.substack.com/w_848, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdf57e444-60c6-4451-9bd1-b06c6363bc6f_667x430.png 848w, /__u/substackcdn.com/image/fetch/$s_!Pppr!, /__u/andrealeonel.substack.com/w_1272, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdf57e444-60c6-4451-9bd1-b06c6363bc6f_667x430.png 1272w, /__u/substackcdn.com/image/fetch/$s_!Pppr!, /__u/andrealeonel.substack.com/w_1456, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdf57e444-60c6-4451-9bd1-b06c6363bc6f_667x430.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>I will revisit this eventually, but I needed to move on with the Practice Project. I wanted to be honest and show you how, even after reviewing documentation thoroughly, some configurations are tricky to set up in a real-life environment.</p><p>If anyone&#8217;s got any clue as to what could be causing this issue, send me a message or leave a comment!</p>]]></content:encoded></item><item><title><![CDATA[Practice Project 5: incremental models]]></title><description><![CDATA[Let's add live data to our project and configure our first incremental model.]]></description><link>https://andrealeonel.substack.com/p/practice-project-checkpoint-4-part-c38</link><guid isPermaLink="false">https://andrealeonel.substack.com/p/practice-project-checkpoint-4-part-c38</guid><dc:creator><![CDATA[Andrea Leonel]]></dc:creator><pubDate>Sat, 22 Nov 2025 14:13:05 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!KldJ!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fefcd3539-3525-40d0-a3da-eb45adb016cf_1176x405.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p><em>Part of the <a href="/__u/andrealeonel.substack.com/p/study-for-the-dbt-analytics-engineering">&#8220;Mastering dbt&#8221;</a> series. Access to the full <a href="/__u/andrealeonel.substack.com/p/dbt-analytics-engineering-certification">Study Guide</a>. Let&#8217;s connect on <a href="https://www.linkedin.com/in/andrealeonel/">LinkedIn</a>!</em></p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://andrealeonel.substack.com/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption">Join hundreds of aspiring dbt developers &amp; data&nbsp;analysts!</p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="/__u/substackcdn.com/image/fetch/$s_!KldJ!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fefcd3539-3525-40d0-a3da-eb45adb016cf_1176x405.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="/__u/substackcdn.com/image/fetch/$s_!KldJ!, /__u/andrealeonel.substack.com/w_424, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fefcd3539-3525-40d0-a3da-eb45adb016cf_1176x405.png 424w, /__u/substackcdn.com/image/fetch/$s_!KldJ!, /__u/andrealeonel.substack.com/w_848, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fefcd3539-3525-40d0-a3da-eb45adb016cf_1176x405.png 848w, /__u/substackcdn.com/image/fetch/$s_!KldJ!, /__u/andrealeonel.substack.com/w_1272, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fefcd3539-3525-40d0-a3da-eb45adb016cf_1176x405.png 1272w, /__u/substackcdn.com/image/fetch/$s_!KldJ!, /__u/andrealeonel.substack.com/w_1456, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fefcd3539-3525-40d0-a3da-eb45adb016cf_1176x405.png 1456w" sizes="100vw"><img src="/__u/substackcdn.com/image/fetch/$s_!KldJ!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fefcd3539-3525-40d0-a3da-eb45adb016cf_1176x405.png" width="1176" height="405" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/efcd3539-3525-40d0-a3da-eb45adb016cf_1176x405.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:405,&quot;width&quot;:1176,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:600288,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:&quot;https://andrealeonel.substack.com/i/179488561?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fefcd3539-3525-40d0-a3da-eb45adb016cf_1176x405.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="/__u/substackcdn.com/image/fetch/$s_!KldJ!, /__u/andrealeonel.substack.com/w_424, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fefcd3539-3525-40d0-a3da-eb45adb016cf_1176x405.png 424w, /__u/substackcdn.com/image/fetch/$s_!KldJ!, /__u/andrealeonel.substack.com/w_848, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fefcd3539-3525-40d0-a3da-eb45adb016cf_1176x405.png 848w, /__u/substackcdn.com/image/fetch/$s_!KldJ!, /__u/andrealeonel.substack.com/w_1272, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fefcd3539-3525-40d0-a3da-eb45adb016cf_1176x405.png 1272w, /__u/substackcdn.com/image/fetch/$s_!KldJ!, /__u/andrealeonel.substack.com/w_1456, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fefcd3539-3525-40d0-a3da-eb45adb016cf_1176x405.png 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p><a href="/__u/andrealeonel.substack.com/p/incremental-materialisations">Incremental materialisation</a> is one of the trickier configurations of dbt. It requires attention to detail as the placement of the configs affects how and when the incremental rows will be processed.</p><p>I covered only the essentials in incremental materialisations in this post due to a limitation of my adapter&#8217;s free tier. I think a real-life scenario would present more challenges than I was able to replicate here.</p><p>Still, this is good practice to understand the intricacies of this type of materialisation and the many ways in which it can be configured.</p><div><hr></div><h3>Incorporating live data into our project:</h3><p>So far, we have been working with static data in our Practice Project. Now, thanks to <a href="https://leo-godin.medium.com/learn-dbt-with-real-fake-data-68d6d21c3e8f">Leo Godin&#8217;s efforts in setting this fake database up</a>, we are going to add live data.</p><p>Our project will now receive new orders every day. We will assume no new employees, products, or companies are added. Only new orders.</p><h4>Setting up the new connection:</h4><p>Godin&#8217;s data is hosted in a public BigQuery dataset that we can directly add as a source to our project. You can view documentation on the full dataset <a href="https://leogodin217.github.io/dbt-fake/#!/model/model.dbt_fake_company.companies_base#columns">here</a>.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="/__u/substackcdn.com/image/fetch/$s_!XdH0!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe6aba8be-afda-48f8-9165-ba5280d08a28_1287x415.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="/__u/substackcdn.com/image/fetch/$s_!XdH0!, /__u/andrealeonel.substack.com/w_424, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe6aba8be-afda-48f8-9165-ba5280d08a28_1287x415.png 424w, /__u/substackcdn.com/image/fetch/$s_!XdH0!, /__u/andrealeonel.substack.com/w_848, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe6aba8be-afda-48f8-9165-ba5280d08a28_1287x415.png 848w, /__u/substackcdn.com/image/fetch/$s_!XdH0!, /__u/andrealeonel.substack.com/w_1272, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe6aba8be-afda-48f8-9165-ba5280d08a28_1287x415.png 1272w, /__u/substackcdn.com/image/fetch/$s_!XdH0!, /__u/andrealeonel.substack.com/w_1456, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe6aba8be-afda-48f8-9165-ba5280d08a28_1287x415.png 1456w" sizes="100vw"><img src="/__u/substackcdn.com/image/fetch/$s_!XdH0!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe6aba8be-afda-48f8-9165-ba5280d08a28_1287x415.png" width="1287" height="415" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/e6aba8be-afda-48f8-9165-ba5280d08a28_1287x415.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:415,&quot;width&quot;:1287,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:53669,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://andrealeonel.substack.com/i/179488561?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe6aba8be-afda-48f8-9165-ba5280d08a28_1287x415.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="/__u/substackcdn.com/image/fetch/$s_!XdH0!, /__u/andrealeonel.substack.com/w_424, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe6aba8be-afda-48f8-9165-ba5280d08a28_1287x415.png 424w, /__u/substackcdn.com/image/fetch/$s_!XdH0!, /__u/andrealeonel.substack.com/w_848, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe6aba8be-afda-48f8-9165-ba5280d08a28_1287x415.png 848w, /__u/substackcdn.com/image/fetch/$s_!XdH0!, /__u/andrealeonel.substack.com/w_1272, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe6aba8be-afda-48f8-9165-ba5280d08a28_1287x415.png 1272w, /__u/substackcdn.com/image/fetch/$s_!XdH0!, /__u/andrealeonel.substack.com/w_1456, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe6aba8be-afda-48f8-9165-ba5280d08a28_1287x415.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption">Adding live data to our sources.yml file.</figcaption></figure></div><h4>Replacing the source of our orders table:</h4><p>Now, we are going to replace the orders source in the &#8220;stg_orders&#8221; model. Optionally, you can also remove the static orders table from the source.yml file or use the &#8220;enable: false&#8221; property to remove it from the project.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="/__u/substackcdn.com/image/fetch/$s_!LXSd!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fda999dd6-335d-466d-b9c3-d4ab80535cb2_1140x504.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="/__u/substackcdn.com/image/fetch/$s_!LXSd!, /__u/andrealeonel.substack.com/w_424, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fda999dd6-335d-466d-b9c3-d4ab80535cb2_1140x504.png 424w, /__u/substackcdn.com/image/fetch/$s_!LXSd!, /__u/andrealeonel.substack.com/w_848, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fda999dd6-335d-466d-b9c3-d4ab80535cb2_1140x504.png 848w, /__u/substackcdn.com/image/fetch/$s_!LXSd!, /__u/andrealeonel.substack.com/w_1272, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fda999dd6-335d-466d-b9c3-d4ab80535cb2_1140x504.png 1272w, /__u/substackcdn.com/image/fetch/$s_!LXSd!, /__u/andrealeonel.substack.com/w_1456, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fda999dd6-335d-466d-b9c3-d4ab80535cb2_1140x504.png 1456w" sizes="100vw"><img src="/__u/substackcdn.com/image/fetch/$s_!LXSd!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fda999dd6-335d-466d-b9c3-d4ab80535cb2_1140x504.png" width="1140" height="504" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/da999dd6-335d-466d-b9c3-d4ab80535cb2_1140x504.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:504,&quot;width&quot;:1140,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:62030,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://andrealeonel.substack.com/i/179488561?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fda999dd6-335d-466d-b9c3-d4ab80535cb2_1140x504.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="/__u/substackcdn.com/image/fetch/$s_!LXSd!, /__u/andrealeonel.substack.com/w_424, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fda999dd6-335d-466d-b9c3-d4ab80535cb2_1140x504.png 424w, /__u/substackcdn.com/image/fetch/$s_!LXSd!, /__u/andrealeonel.substack.com/w_848, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fda999dd6-335d-466d-b9c3-d4ab80535cb2_1140x504.png 848w, /__u/substackcdn.com/image/fetch/$s_!LXSd!, /__u/andrealeonel.substack.com/w_1272, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fda999dd6-335d-466d-b9c3-d4ab80535cb2_1140x504.png 1272w, /__u/substackcdn.com/image/fetch/$s_!LXSd!, /__u/andrealeonel.substack.com/w_1456, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fda999dd6-335d-466d-b9c3-d4ab80535cb2_1140x504.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption">The orders are now captured from the live table.</figcaption></figure></div><h4>Configuring the incremental materialisation:</h4><p>You want to add the incremental strategy in the layer where the heaviest transformations take place. This way, these costly operations will only be applied to new rows at each run. </p><p>In our case, the optimal model is int_orders_detail. We are also going to implement a merge strategy and limit the scan of new records to orders from 2025. We are taking the assumption that orders from previous years never change.</p><p>Please note that I&#8217;m working on BigQuery&#8217;s free tier in this project, which doesn&#8217;t support DML queries. Therefore, even with the correct configurations, the &#8220;dbt build&#8221; command will still fail. However, the logs will show us that dbt tried to implement the incremental materialisation.</p><p><strong>dbt_project.yml configuration</strong></p><p>According to the <a href="https://docs.getdbt.com/docs/build/incremental-strategy">documentation</a>, you can add the incremental configurations to the dbt_project.yml or the model itself.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="/__u/substackcdn.com/image/fetch/$s_!IwGf!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb7c2639d-3e61-42b8-b2f7-7152e86448d6_1267x342.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="/__u/substackcdn.com/image/fetch/$s_!IwGf!, /__u/andrealeonel.substack.com/w_424, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb7c2639d-3e61-42b8-b2f7-7152e86448d6_1267x342.png 424w, /__u/substackcdn.com/image/fetch/$s_!IwGf!, /__u/andrealeonel.substack.com/w_848, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb7c2639d-3e61-42b8-b2f7-7152e86448d6_1267x342.png 848w, /__u/substackcdn.com/image/fetch/$s_!IwGf!, /__u/andrealeonel.substack.com/w_1272, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb7c2639d-3e61-42b8-b2f7-7152e86448d6_1267x342.png 1272w, /__u/substackcdn.com/image/fetch/$s_!IwGf!, /__u/andrealeonel.substack.com/w_1456, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb7c2639d-3e61-42b8-b2f7-7152e86448d6_1267x342.png 1456w" sizes="100vw"><img src="/__u/substackcdn.com/image/fetch/$s_!IwGf!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb7c2639d-3e61-42b8-b2f7-7152e86448d6_1267x342.png" width="1267" height="342" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/b7c2639d-3e61-42b8-b2f7-7152e86448d6_1267x342.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:342,&quot;width&quot;:1267,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:42771,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://andrealeonel.substack.com/i/179488561?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb7c2639d-3e61-42b8-b2f7-7152e86448d6_1267x342.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="/__u/substackcdn.com/image/fetch/$s_!IwGf!, /__u/andrealeonel.substack.com/w_424, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb7c2639d-3e61-42b8-b2f7-7152e86448d6_1267x342.png 424w, /__u/substackcdn.com/image/fetch/$s_!IwGf!, /__u/andrealeonel.substack.com/w_848, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb7c2639d-3e61-42b8-b2f7-7152e86448d6_1267x342.png 848w, /__u/substackcdn.com/image/fetch/$s_!IwGf!, /__u/andrealeonel.substack.com/w_1272, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb7c2639d-3e61-42b8-b2f7-7152e86448d6_1267x342.png 1272w, /__u/substackcdn.com/image/fetch/$s_!IwGf!, /__u/andrealeonel.substack.com/w_1456, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb7c2639d-3e61-42b8-b2f7-7152e86448d6_1267x342.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption">Setting up the incremental materialisation in the dbt_project.yml file. Some parameters are underlined red, but these are false warnings.</figcaption></figure></div><p>Upon trying to build the models, the command fails and the logs show that dbt tried to run a DML query, but my adapter has billing disabled.</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="/__u/substackcdn.com/image/fetch/$s_!shyQ!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F69386b92-cf8d-417d-833e-a77c435a9f79_1114x232.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="/__u/substackcdn.com/image/fetch/$s_!shyQ!, /__u/andrealeonel.substack.com/w_424, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F69386b92-cf8d-417d-833e-a77c435a9f79_1114x232.png 424w, /__u/substackcdn.com/image/fetch/$s_!shyQ!, /__u/andrealeonel.substack.com/w_848, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F69386b92-cf8d-417d-833e-a77c435a9f79_1114x232.png 848w, /__u/substackcdn.com/image/fetch/$s_!shyQ!, /__u/andrealeonel.substack.com/w_1272, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F69386b92-cf8d-417d-833e-a77c435a9f79_1114x232.png 1272w, /__u/substackcdn.com/image/fetch/$s_!shyQ!, /__u/andrealeonel.substack.com/w_1456, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F69386b92-cf8d-417d-833e-a77c435a9f79_1114x232.png 1456w" sizes="100vw"><img src="/__u/substackcdn.com/image/fetch/$s_!shyQ!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F69386b92-cf8d-417d-833e-a77c435a9f79_1114x232.png" width="1114" height="232" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/69386b92-cf8d-417d-833e-a77c435a9f79_1114x232.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:232,&quot;width&quot;:1114,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:34747,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://andrealeonel.substack.com/i/179488561?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F69386b92-cf8d-417d-833e-a77c435a9f79_1114x232.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="/__u/substackcdn.com/image/fetch/$s_!shyQ!, /__u/andrealeonel.substack.com/w_424, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F69386b92-cf8d-417d-833e-a77c435a9f79_1114x232.png 424w, /__u/substackcdn.com/image/fetch/$s_!shyQ!, /__u/andrealeonel.substack.com/w_848, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F69386b92-cf8d-417d-833e-a77c435a9f79_1114x232.png 848w, /__u/substackcdn.com/image/fetch/$s_!shyQ!, /__u/andrealeonel.substack.com/w_1272, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F69386b92-cf8d-417d-833e-a77c435a9f79_1114x232.png 1272w, /__u/substackcdn.com/image/fetch/$s_!shyQ!, /__u/andrealeonel.substack.com/w_1456, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F69386b92-cf8d-417d-833e-a77c435a9f79_1114x232.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a><figcaption class="image-caption">Logs from the failed build of int_orders_detail.</figcaption></figure></div><p><strong>In-model configuration</strong></p><p>Using a config block, we can set all the configs for the incremental materialisation in the block itself. Remember that this block can be placed strategically in the code (for example, after the data has been filtered).</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="/__u/substackcdn.com/image/fetch/$s_!ssYN!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F09d95854-ec3a-4832-b4cd-c6f797e24a1d_1206x463.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="/__u/substackcdn.com/image/fetch/$s_!ssYN!, /__u/andrealeonel.substack.com/w_424, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F09d95854-ec3a-4832-b4cd-c6f797e24a1d_1206x463.png 424w, /__u/substackcdn.com/image/fetch/$s_!ssYN!, /__u/andrealeonel.substack.com/w_848, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F09d95854-ec3a-4832-b4cd-c6f797e24a1d_1206x463.png 848w, /__u/substackcdn.com/image/fetch/$s_!ssYN!, /__u/andrealeonel.substack.com/w_1272, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F09d95854-ec3a-4832-b4cd-c6f797e24a1d_1206x463.png 1272w, /__u/substackcdn.com/image/fetch/$s_!ssYN!, /__u/andrealeonel.substack.com/w_1456, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F09d95854-ec3a-4832-b4cd-c6f797e24a1d_1206x463.png 1456w" sizes="100vw"><img src="/__u/substackcdn.com/image/fetch/$s_!ssYN!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F09d95854-ec3a-4832-b4cd-c6f797e24a1d_1206x463.png" width="1206" height="463" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/09d95854-ec3a-4832-b4cd-c6f797e24a1d_1206x463.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:463,&quot;width&quot;:1206,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:46561,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://andrealeonel.substack.com/i/179488561?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F09d95854-ec3a-4832-b4cd-c6f797e24a1d_1206x463.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="/__u/substackcdn.com/image/fetch/$s_!ssYN!, /__u/andrealeonel.substack.com/w_424, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F09d95854-ec3a-4832-b4cd-c6f797e24a1d_1206x463.png 424w, /__u/substackcdn.com/image/fetch/$s_!ssYN!, /__u/andrealeonel.substack.com/w_848, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F09d95854-ec3a-4832-b4cd-c6f797e24a1d_1206x463.png 848w, /__u/substackcdn.com/image/fetch/$s_!ssYN!, /__u/andrealeonel.substack.com/w_1272, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F09d95854-ec3a-4832-b4cd-c6f797e24a1d_1206x463.png 1272w, /__u/substackcdn.com/image/fetch/$s_!ssYN!, /__u/andrealeonel.substack.com/w_1456, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F09d95854-ec3a-4832-b4cd-c6f797e24a1d_1206x463.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption">Setting the int_orders_detail as an incremental model.</figcaption></figure></div><p>The logs are even more detailed in this case. You can see dbt tried to merge the new records, applied our predicates, and only searched for new records within orders from 2025.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="/__u/substackcdn.com/image/fetch/$s_!lKiB!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F64b54865-2e22-4c75-8496-dee1098a246e_1045x360.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="/__u/substackcdn.com/image/fetch/$s_!lKiB!, /__u/andrealeonel.substack.com/w_424, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F64b54865-2e22-4c75-8496-dee1098a246e_1045x360.png 424w, /__u/substackcdn.com/image/fetch/$s_!lKiB!, /__u/andrealeonel.substack.com/w_848, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F64b54865-2e22-4c75-8496-dee1098a246e_1045x360.png 848w, /__u/substackcdn.com/image/fetch/$s_!lKiB!, /__u/andrealeonel.substack.com/w_1272, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F64b54865-2e22-4c75-8496-dee1098a246e_1045x360.png 1272w, /__u/substackcdn.com/image/fetch/$s_!lKiB!, /__u/andrealeonel.substack.com/w_1456, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F64b54865-2e22-4c75-8496-dee1098a246e_1045x360.png 1456w" sizes="100vw"><img src="/__u/substackcdn.com/image/fetch/$s_!lKiB!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F64b54865-2e22-4c75-8496-dee1098a246e_1045x360.png" width="1045" height="360" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/64b54865-2e22-4c75-8496-dee1098a246e_1045x360.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:360,&quot;width&quot;:1045,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:23338,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://andrealeonel.substack.com/i/179488561?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F64b54865-2e22-4c75-8496-dee1098a246e_1045x360.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="/__u/substackcdn.com/image/fetch/$s_!lKiB!, /__u/andrealeonel.substack.com/w_424, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F64b54865-2e22-4c75-8496-dee1098a246e_1045x360.png 424w, /__u/substackcdn.com/image/fetch/$s_!lKiB!, /__u/andrealeonel.substack.com/w_848, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F64b54865-2e22-4c75-8496-dee1098a246e_1045x360.png 848w, /__u/substackcdn.com/image/fetch/$s_!lKiB!, /__u/andrealeonel.substack.com/w_1272, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F64b54865-2e22-4c75-8496-dee1098a246e_1045x360.png 1272w, /__u/substackcdn.com/image/fetch/$s_!lKiB!, /__u/andrealeonel.substack.com/w_1456, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F64b54865-2e22-4c75-8496-dee1098a246e_1045x360.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption">The logs of my failed build showed that the compiled code included a merge statement.</figcaption></figure></div><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="/__u/substackcdn.com/image/fetch/$s_!WhOJ!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fec1c2a99-f0d8-48c7-bb16-fc3670265777_1042x538.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="/__u/substackcdn.com/image/fetch/$s_!WhOJ!, /__u/andrealeonel.substack.com/w_424, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fec1c2a99-f0d8-48c7-bb16-fc3670265777_1042x538.png 424w, /__u/substackcdn.com/image/fetch/$s_!WhOJ!, /__u/andrealeonel.substack.com/w_848, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fec1c2a99-f0d8-48c7-bb16-fc3670265777_1042x538.png 848w, /__u/substackcdn.com/image/fetch/$s_!WhOJ!, /__u/andrealeonel.substack.com/w_1272, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fec1c2a99-f0d8-48c7-bb16-fc3670265777_1042x538.png 1272w, /__u/substackcdn.com/image/fetch/$s_!WhOJ!, /__u/andrealeonel.substack.com/w_1456, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fec1c2a99-f0d8-48c7-bb16-fc3670265777_1042x538.png 1456w" sizes="100vw"><img src="/__u/substackcdn.com/image/fetch/$s_!WhOJ!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fec1c2a99-f0d8-48c7-bb16-fc3670265777_1042x538.png" width="1042" height="538" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/ec1c2a99-f0d8-48c7-bb16-fc3670265777_1042x538.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:538,&quot;width&quot;:1042,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:69682,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://andrealeonel.substack.com/i/179488561?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fec1c2a99-f0d8-48c7-bb16-fc3670265777_1042x538.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="/__u/substackcdn.com/image/fetch/$s_!WhOJ!, /__u/andrealeonel.substack.com/w_424, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fec1c2a99-f0d8-48c7-bb16-fc3670265777_1042x538.png 424w, /__u/substackcdn.com/image/fetch/$s_!WhOJ!, /__u/andrealeonel.substack.com/w_848, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fec1c2a99-f0d8-48c7-bb16-fc3670265777_1042x538.png 848w, /__u/substackcdn.com/image/fetch/$s_!WhOJ!, /__u/andrealeonel.substack.com/w_1272, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fec1c2a99-f0d8-48c7-bb16-fc3670265777_1042x538.png 1272w, /__u/substackcdn.com/image/fetch/$s_!WhOJ!, /__u/andrealeonel.substack.com/w_1456, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fec1c2a99-f0d8-48c7-bb16-fc3670265777_1042x538.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption">dbt is limiting the scan as per our predicates and clearly outlines what to do for each record.</figcaption></figure></div><p>We can also apply a simpler configuration to your incremental materialisation using the is_incremental macro:</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="/__u/substackcdn.com/image/fetch/$s_!ef9u!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbdc8b2ea-8d01-4d7d-9504-0d86e7b7f5d8_1297x549.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="/__u/substackcdn.com/image/fetch/$s_!ef9u!, /__u/andrealeonel.substack.com/w_424, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbdc8b2ea-8d01-4d7d-9504-0d86e7b7f5d8_1297x549.png 424w, /__u/substackcdn.com/image/fetch/$s_!ef9u!, /__u/andrealeonel.substack.com/w_848, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbdc8b2ea-8d01-4d7d-9504-0d86e7b7f5d8_1297x549.png 848w, /__u/substackcdn.com/image/fetch/$s_!ef9u!, /__u/andrealeonel.substack.com/w_1272, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbdc8b2ea-8d01-4d7d-9504-0d86e7b7f5d8_1297x549.png 1272w, /__u/substackcdn.com/image/fetch/$s_!ef9u!, /__u/andrealeonel.substack.com/w_1456, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbdc8b2ea-8d01-4d7d-9504-0d86e7b7f5d8_1297x549.png 1456w" sizes="100vw"><img src="/__u/substackcdn.com/image/fetch/$s_!ef9u!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbdc8b2ea-8d01-4d7d-9504-0d86e7b7f5d8_1297x549.png" width="1297" height="549" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/bdc8b2ea-8d01-4d7d-9504-0d86e7b7f5d8_1297x549.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:549,&quot;width&quot;:1297,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:57572,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://andrealeonel.substack.com/i/179488561?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbdc8b2ea-8d01-4d7d-9504-0d86e7b7f5d8_1297x549.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="/__u/substackcdn.com/image/fetch/$s_!ef9u!, /__u/andrealeonel.substack.com/w_424, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbdc8b2ea-8d01-4d7d-9504-0d86e7b7f5d8_1297x549.png 424w, /__u/substackcdn.com/image/fetch/$s_!ef9u!, /__u/andrealeonel.substack.com/w_848, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbdc8b2ea-8d01-4d7d-9504-0d86e7b7f5d8_1297x549.png 848w, /__u/substackcdn.com/image/fetch/$s_!ef9u!, /__u/andrealeonel.substack.com/w_1272, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbdc8b2ea-8d01-4d7d-9504-0d86e7b7f5d8_1297x549.png 1272w, /__u/substackcdn.com/image/fetch/$s_!ef9u!, /__u/andrealeonel.substack.com/w_1456, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbdc8b2ea-8d01-4d7d-9504-0d86e7b7f5d8_1297x549.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption">Applying the is_incremental macro to process new rows only.</figcaption></figure></div><p>While incremental_predicates filter the rows that the warehouse will consider during the MERGE step, is_incremental( ) filters the rows selected from your source before the merge happens.</p>]]></content:encoded></item><item><title><![CDATA[Week 13-14: New study notes and landing a job in the age of AI recruiting]]></title><description><![CDATA[Plus, Python models, Jinja & macros and beginning of the Practice Project.]]></description><link>https://andrealeonel.substack.com/p/week-13-14-new-study-notes-and-landing</link><guid isPermaLink="false">https://andrealeonel.substack.com/p/week-13-14-new-study-notes-and-landing</guid><dc:creator><![CDATA[Andrea Leonel]]></dc:creator><pubDate>Mon, 17 Nov 2025 10:01:53 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!4W9u!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4a7a929f-da79-4664-abe5-e030d1e5f950_960x318.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p><em>Part of the <a href="/__u/andrealeonel.substack.com/p/study-for-the-dbt-analytics-engineering">&#8220;Mastering dbt&#8221;</a> series. Access to the full <a href="/__u/andrealeonel.substack.com/p/dbt-analytics-engineering-certification">Study Guide</a>. Let&#8217;s connect on <a href="https://www.linkedin.com/in/andrealeonel/">LinkedIn</a>!</em></p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://andrealeonel.substack.com/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption">Join hundreds of aspiring dbt developers &amp; data&nbsp;analysts!</p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="/__u/substackcdn.com/image/fetch/$s_!4W9u!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4a7a929f-da79-4664-abe5-e030d1e5f950_960x318.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="/__u/substackcdn.com/image/fetch/$s_!4W9u!, /__u/andrealeonel.substack.com/w_424, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4a7a929f-da79-4664-abe5-e030d1e5f950_960x318.png 424w, /__u/substackcdn.com/image/fetch/$s_!4W9u!, /__u/andrealeonel.substack.com/w_848, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4a7a929f-da79-4664-abe5-e030d1e5f950_960x318.png 848w, /__u/substackcdn.com/image/fetch/$s_!4W9u!, /__u/andrealeonel.substack.com/w_1272, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4a7a929f-da79-4664-abe5-e030d1e5f950_960x318.png 1272w, /__u/substackcdn.com/image/fetch/$s_!4W9u!, /__u/andrealeonel.substack.com/w_1456, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4a7a929f-da79-4664-abe5-e030d1e5f950_960x318.png 1456w" sizes="100vw"><img src="/__u/substackcdn.com/image/fetch/$s_!4W9u!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4a7a929f-da79-4664-abe5-e030d1e5f950_960x318.png" width="960" height="318" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/4a7a929f-da79-4664-abe5-e030d1e5f950_960x318.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:318,&quot;width&quot;:960,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:525829,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:&quot;https://andrealeonel.substack.com/i/173207390?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4a7a929f-da79-4664-abe5-e030d1e5f950_960x318.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="/__u/substackcdn.com/image/fetch/$s_!4W9u!, /__u/andrealeonel.substack.com/w_424, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4a7a929f-da79-4664-abe5-e030d1e5f950_960x318.png 424w, /__u/substackcdn.com/image/fetch/$s_!4W9u!, /__u/andrealeonel.substack.com/w_848, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4a7a929f-da79-4664-abe5-e030d1e5f950_960x318.png 848w, /__u/substackcdn.com/image/fetch/$s_!4W9u!, /__u/andrealeonel.substack.com/w_1272, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4a7a929f-da79-4664-abe5-e030d1e5f950_960x318.png 1272w, /__u/substackcdn.com/image/fetch/$s_!4W9u!, /__u/andrealeonel.substack.com/w_1456, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4a7a929f-da79-4664-abe5-e030d1e5f950_960x318.png 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>The past 2 weeks have been hectic as I started a new job AND moved flats in the same week - I do not recommend it!</p><p>I did slow down with the posts a bit, but I have no intention of abandoning this project. With a full-time job, I&#8217;ll obviously need to adapt my schedule, but I aim to post at least once a week.</p><p>Speaking of the new job, in addition to the study notes from the past two weeks, I've included some valuable tips for landing a job in the age of AI recruiting below. Next week, I&#8217;ll share more about my new job itself.</p><div><hr></div><h3>Study notes added: </h3><p>We finished the topics for Checkpoint 4 and began applying our learnings to the Practice Project. We covered a lot of topics in this Checkpoint, so the Practice posts will be broken into a few different parts.</p><div class="digest-post-embed" data-attrs="{&quot;nodeId&quot;:&quot;43b5713a-a598-49c1-8d6f-932e9b34364a&quot;,&quot;caption&quot;:&quot;Part of the &#8220;Mastering dbt&#8221; series. Access to the full Study Guide. Let&#8217;s connect on LinkedIn!&quot;,&quot;cta&quot;:&quot;Read full story&quot;,&quot;showBylines&quot;:true,&quot;showDescription&quot;:true,&quot;showImage&quot;:true,&quot;size&quot;:&quot;sm&quot;,&quot;isEditorNode&quot;:true,&quot;title&quot;:&quot;Python models&quot;,&quot;publishedBylines&quot;:[],&quot;post_date&quot;:&quot;2025-11-05T19:15:42.406Z&quot;,&quot;cover_image&quot;:&quot;https://substackcdn.com/image/fetch/$s_!Vnc6!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F903300c3-1369-4ade-858f-4239a8f89e20_1000x379.png&quot;,&quot;cover_image_alt&quot;:null,&quot;canonical_url&quot;:&quot;https://andrealeonel.substack.com/p/python-models&quot;,&quot;section_name&quot;:&quot;Mastering dbt&quot;,&quot;video_upload_id&quot;:null,&quot;id&quot;:177765627,&quot;type&quot;:&quot;newsletter&quot;,&quot;reaction_count&quot;:0,&quot;comment_count&quot;:0,&quot;publication_id&quot;:2945779,&quot;publication_name&quot;:&quot;Andrea Leonel - Data Analysis &amp; Analytics Engineering&quot;,&quot;publication_logo_url&quot;:&quot;https://substackcdn.com/image/fetch/$s_!TwlV!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0b5ecf6f-7ab0-4ae3-a73f-95478b9fef4e_500x500.png&quot;,&quot;belowTheFold&quot;:true,&quot;youtube_url&quot;:null,&quot;show_links&quot;:null,&quot;feed_url&quot;:null}"></div><div class="digest-post-embed" data-attrs="{&quot;nodeId&quot;:&quot;63914e7e-0f39-4260-9263-f3f60d9f6f35&quot;,&quot;caption&quot;:&quot;Part of the &#8220;Mastering dbt&#8221; series. Access to the full Study Guide. Let&#8217;s connect on LinkedIn!&quot;,&quot;cta&quot;:&quot;Read full story&quot;,&quot;showBylines&quot;:true,&quot;showDescription&quot;:true,&quot;showImage&quot;:true,&quot;size&quot;:&quot;sm&quot;,&quot;isEditorNode&quot;:true,&quot;title&quot;:&quot;Jinja &amp; Macros within dbt&quot;,&quot;publishedBylines&quot;:[],&quot;post_date&quot;:&quot;2025-11-06T21:42:13.950Z&quot;,&quot;cover_image&quot;:&quot;https://substackcdn.com/image/fetch/$s_!sURC!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F329197a9-69e7-470a-9d9c-1c61033d78a4_955x324.png&quot;,&quot;cover_image_alt&quot;:null,&quot;canonical_url&quot;:&quot;https://andrealeonel.substack.com/p/jinja-and-macros-within-dbt&quot;,&quot;section_name&quot;:&quot;Mastering dbt&quot;,&quot;video_upload_id&quot;:null,&quot;id&quot;:178114177,&quot;type&quot;:&quot;newsletter&quot;,&quot;reaction_count&quot;:0,&quot;comment_count&quot;:0,&quot;publication_id&quot;:2945779,&quot;publication_name&quot;:&quot;Andrea Leonel - Data Analysis &amp; Analytics Engineering&quot;,&quot;publication_logo_url&quot;:&quot;https://substackcdn.com/image/fetch/$s_!TwlV!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0b5ecf6f-7ab0-4ae3-a73f-95478b9fef4e_500x500.png&quot;,&quot;belowTheFold&quot;:true,&quot;youtube_url&quot;:null,&quot;show_links&quot;:null,&quot;feed_url&quot;:null}"></div><div class="digest-post-embed" data-attrs="{&quot;nodeId&quot;:&quot;8b3edfeb-13ac-4aba-aabc-e8d2a80dd3e5&quot;,&quot;caption&quot;:&quot;Part of the &#8220;Mastering dbt&#8221; series. Access to the full Study Guide. Let&#8217;s connect on LinkedIn!Join hundreds of aspiring dbt developers &amp; data analysts!&quot;,&quot;cta&quot;:&quot;Read full story&quot;,&quot;showBylines&quot;:true,&quot;showDescription&quot;:true,&quot;showImage&quot;:true,&quot;size&quot;:&quot;sm&quot;,&quot;isEditorNode&quot;:true,&quot;title&quot;:&quot;Practice Project: Checkpoint 4 - Part 1&quot;,&quot;publishedBylines&quot;:[{&quot;id&quot;:86941928,&quot;name&quot;:&quot;Andrea Leonel&quot;,&quot;bio&quot;:&quot;Woman travels solo around the world and writes about it&quot;,&quot;photo_url&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/edaed6ba-e79c-4627-8606-986981a657e1_1125x1125.jpeg&quot;,&quot;is_guest&quot;:false,&quot;bestseller_tier&quot;:null}],&quot;post_date&quot;:&quot;2025-11-09T18:35:57.586Z&quot;,&quot;cover_image&quot;:&quot;https://substackcdn.com/image/fetch/$s_!0F5H!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa2b57814-516b-48f0-8a87-c61edfe4256c_1180x351.png&quot;,&quot;cover_image_alt&quot;:null,&quot;canonical_url&quot;:&quot;https://andrealeonel.substack.com/p/practice-project-checkpoint-4-part&quot;,&quot;section_name&quot;:&quot;Mastering dbt&quot;,&quot;video_upload_id&quot;:null,&quot;id&quot;:175751983,&quot;type&quot;:&quot;newsletter&quot;,&quot;reaction_count&quot;:0,&quot;comment_count&quot;:0,&quot;publication_id&quot;:2945779,&quot;publication_name&quot;:&quot;Andrea Leonel - Data Analysis &amp; Analytics Engineering&quot;,&quot;publication_logo_url&quot;:&quot;https://substackcdn.com/image/fetch/$s_!TwlV!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0b5ecf6f-7ab0-4ae3-a73f-95478b9fef4e_500x500.png&quot;,&quot;belowTheFold&quot;:true,&quot;youtube_url&quot;:null,&quot;show_links&quot;:null,&quot;feed_url&quot;:null}"></div><p><a href="/__u/andrealeonel.substack.com/p/dbt-analytics-engineering-certification">A full list of the study notes is available in the study guide.</a></p><div><hr></div><h3>Here&#8217;s how to land a job in the age of AI recruiting</h3><p>TL;DR: Work on side projects (like this dbt Study Guide) and talk about them on LinkedIn to increase your profile visibility.</p><p>I quit my data job in July 2024 to freelance and upskill. A year later, I felt the need to put my new skills into practice, so I began job hunting.</p><p>I started searching while in Europe, but the market was flat. After months of insisting, I made the tough call to return to Brazil&#8212;where I got hired in under a month.</p><p>However, even though the Brazilian tech market was booming, I never landed an interview for the dozens of jobs I proactively applied for. But every week, recruiters kept approaching me on LinkedIn. One of those messages led to the job I just started.</p><p>Sure, my 10-year on-and-off experience in data and a recent Big 4 contract helped to attract the recruiters. But it&#8217;s also worth noting that since launching my Study Guide, my LinkedIn visibility increased 9&#215;.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="/__u/substackcdn.com/image/fetch/$s_!zs0V!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F595ba743-863e-46bf-b63d-949fa4a68287_1168x604.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="/__u/substackcdn.com/image/fetch/$s_!zs0V!, /__u/andrealeonel.substack.com/w_424, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F595ba743-863e-46bf-b63d-949fa4a68287_1168x604.png 424w, /__u/substackcdn.com/image/fetch/$s_!zs0V!, /__u/andrealeonel.substack.com/w_848, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F595ba743-863e-46bf-b63d-949fa4a68287_1168x604.png 848w, /__u/substackcdn.com/image/fetch/$s_!zs0V!, /__u/andrealeonel.substack.com/w_1272, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F595ba743-863e-46bf-b63d-949fa4a68287_1168x604.png 1272w, /__u/substackcdn.com/image/fetch/$s_!zs0V!, /__u/andrealeonel.substack.com/w_1456, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F595ba743-863e-46bf-b63d-949fa4a68287_1168x604.png 1456w" sizes="100vw"><img src="/__u/substackcdn.com/image/fetch/$s_!zs0V!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F595ba743-863e-46bf-b63d-949fa4a68287_1168x604.png" width="1168" height="604" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/595ba743-863e-46bf-b63d-949fa4a68287_1168x604.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:604,&quot;width&quot;:1168,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:31198,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://andrealeonel.substack.com/i/178113773?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F595ba743-863e-46bf-b63d-949fa4a68287_1168x604.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="/__u/substackcdn.com/image/fetch/$s_!zs0V!, /__u/andrealeonel.substack.com/w_424, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F595ba743-863e-46bf-b63d-949fa4a68287_1168x604.png 424w, /__u/substackcdn.com/image/fetch/$s_!zs0V!, /__u/andrealeonel.substack.com/w_848, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F595ba743-863e-46bf-b63d-949fa4a68287_1168x604.png 848w, /__u/substackcdn.com/image/fetch/$s_!zs0V!, /__u/andrealeonel.substack.com/w_1272, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F595ba743-863e-46bf-b63d-949fa4a68287_1168x604.png 1272w, /__u/substackcdn.com/image/fetch/$s_!zs0V!, /__u/andrealeonel.substack.com/w_1456, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F595ba743-863e-46bf-b63d-949fa4a68287_1168x604.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption">My LinkedIn profile impressions.</figcaption></figure></div><p>The first big spike came when I announced the dbt Study Guide on 30th July (23.5k impressions). The next jump happened when I posted about speaking at the dbt Labs HQ in Dublin.</p><p>During this period, I gained 699 new connections&#8212;loads of aspiring data pros, but over half were senior professionals and people in IT services and consulting. LinkedIn won&#8217;t show how many recruiters follow me, but they definitely sit within these groups.</p><p>The bottom line: </p><p>AI has transformed job hunting. Candidates can now blast tailored CVs at scale, and HR teams use AI to filter the flood. Speaking to a human about your skills is harder than ever.</p><p>So, you need to let the recruiters come to you.</p><p>Show your work publicly. Share your learning, your projects, your Zoomcamps&#8212;whatever you&#8217;re building while you&#8217;re job searching.</p><p>Don&#8217;t stand still during your job search, applying mindlessly. Stand out and show yourself.</p><p>(Speaking of which, <a href="https://datatalks.club/blog/data-engineering-zoomcamp.html">DataTalks Club has a new cohort for their Data Engineering zoomcamp</a> coming up soon!)</p><div><hr></div><p><em>Does this make sense to you? I would love to hear from you here or on <a href="https://www.linkedin.com/in/andrealeonel/">LinkedIn</a>!</em></p>]]></content:encoded></item><item><title><![CDATA[Practice Project 4: seeds, packages and macros]]></title><description><![CDATA[Adding Seeds, installing Packages from different sources and writing custom macros.]]></description><link>https://andrealeonel.substack.com/p/practice-project-checkpoint-4-part</link><guid isPermaLink="false">https://andrealeonel.substack.com/p/practice-project-checkpoint-4-part</guid><dc:creator><![CDATA[Andrea Leonel]]></dc:creator><pubDate>Sun, 09 Nov 2025 18:35:57 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!0F5H!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa2b57814-516b-48f0-8a87-c61edfe4256c_1180x351.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p><em>Part of the <a href="/__u/andrealeonel.substack.com/p/study-for-the-dbt-analytics-engineering">&#8220;Mastering dbt&#8221;</a> series. Access to the full <a href="/__u/andrealeonel.substack.com/p/dbt-analytics-engineering-certification">Study Guide</a>. Let&#8217;s connect on <a href="https://www.linkedin.com/in/andrealeonel/">LinkedIn</a>!</em></p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://andrealeonel.substack.com/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption">Join hundreds of aspiring dbt developers &amp; data&nbsp;analysts!</p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="/__u/substackcdn.com/image/fetch/$s_!0F5H!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa2b57814-516b-48f0-8a87-c61edfe4256c_1180x351.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="/__u/substackcdn.com/image/fetch/$s_!0F5H!, /__u/andrealeonel.substack.com/w_424, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa2b57814-516b-48f0-8a87-c61edfe4256c_1180x351.png 424w, /__u/substackcdn.com/image/fetch/$s_!0F5H!, /__u/andrealeonel.substack.com/w_848, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa2b57814-516b-48f0-8a87-c61edfe4256c_1180x351.png 848w, /__u/substackcdn.com/image/fetch/$s_!0F5H!, /__u/andrealeonel.substack.com/w_1272, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa2b57814-516b-48f0-8a87-c61edfe4256c_1180x351.png 1272w, /__u/substackcdn.com/image/fetch/$s_!0F5H!, /__u/andrealeonel.substack.com/w_1456, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa2b57814-516b-48f0-8a87-c61edfe4256c_1180x351.png 1456w" sizes="100vw"><img src="/__u/substackcdn.com/image/fetch/$s_!0F5H!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa2b57814-516b-48f0-8a87-c61edfe4256c_1180x351.png" width="1180" height="351" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/a2b57814-516b-48f0-8a87-c61edfe4256c_1180x351.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:351,&quot;width&quot;:1180,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:520930,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:&quot;https://andrealeonel.substack.com/i/175751983?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa2b57814-516b-48f0-8a87-c61edfe4256c_1180x351.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="/__u/substackcdn.com/image/fetch/$s_!0F5H!, /__u/andrealeonel.substack.com/w_424, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa2b57814-516b-48f0-8a87-c61edfe4256c_1180x351.png 424w, /__u/substackcdn.com/image/fetch/$s_!0F5H!, /__u/andrealeonel.substack.com/w_848, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa2b57814-516b-48f0-8a87-c61edfe4256c_1180x351.png 848w, /__u/substackcdn.com/image/fetch/$s_!0F5H!, /__u/andrealeonel.substack.com/w_1272, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa2b57814-516b-48f0-8a87-c61edfe4256c_1180x351.png 1272w, /__u/substackcdn.com/image/fetch/$s_!0F5H!, /__u/andrealeonel.substack.com/w_1456, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa2b57814-516b-48f0-8a87-c61edfe4256c_1180x351.png 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>XX</p><div><hr></div><h3>Incremental materialisation:</h3><ul><li><p>add live data</p></li><li><p>configure with incremental_predicates, unique_id</p></li><li><p>testing the different incremental strategies</p></li><li><p>on_schema_change</p></li></ul>]]></content:encoded></item><item><title><![CDATA[Jinja & Macros within dbt]]></title><description><![CDATA[An overview of using Jinja to build custom macros in dbt.]]></description><link>https://andrealeonel.substack.com/p/jinja-and-macros-within-dbt</link><guid isPermaLink="false">https://andrealeonel.substack.com/p/jinja-and-macros-within-dbt</guid><pubDate>Thu, 06 Nov 2025 21:42:13 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!sURC!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F329197a9-69e7-470a-9d9c-1c61033d78a4_955x324.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p><em>Part of the <a href="/__u/andrealeonel.substack.com/p/study-for-the-dbt-analytics-engineering">&#8220;Mastering dbt&#8221;</a> series. Access to the full <a href="/__u/andrealeonel.substack.com/p/dbt-analytics-engineering-certification">Study Guide</a>. Let&#8217;s connect on <a href="https://www.linkedin.com/in/andrealeonel/">LinkedIn</a>!<br>Notes from the <a href="https://docs.getdbt.com/docs/build/jinja-macros">Jinja &amp; Macros </a>documentation.</em></p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://andrealeonel.substack.com/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption">Join hundreds of aspiring dbt developers &amp; data analysts!</p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div><p>We have covered <a href="/__u/andrealeonel.substack.com/p/understanding-project-dependencies">macros in the context of Packages in a previous post.</a> For this post, we will touch on how to create custom macros using Jinja. </p><p>We&#8217;ll also take the opportunity to understand how Jinja works in the dbt context and some best practices for using Jinja &amp; Macros.</p><div><hr></div><h3>What is Jinja?</h3><p>Jinja is a templating language that enhances the capabilities of SQL. dbt uses it in native functions like  {{ config() }} and {{ ref() }}. But you can also use it to create bespoke macros or within the models.</p><p>These are some examples of what Jinja enables you to do:</p><ul><li><p>Using if statements and for loops</p></li><li><p>Using environment variables for production deployments</p></li><li><p>Change the build according to the target</p></li><li><p>Pivot tables</p></li><li><p>Abstract SQL codes into reusable macros</p></li></ul><p>If you need support using Jinja, you can check out its <a href="http://If you need more support using Jinja, you can check out its own documentation.">own documentation</a> and the <a href="https://docs.getdbt.com/reference/dbt-jinja-functions">dbt-specific functions</a>, like ref and source. But the general syntax for Jinja is below:</p><ul><li><p>Expressions {{ &#8230; }} : when you want to output a string.</p></li><li><p>Statements {{% &#8230; %}} : used for if statements, for loops, or variable control.</p></li><li><p>Comments {{# &#8230; #}} : used for comments.</p></li><li><p>You can also use a minus sign to remove unwanted whitespace in the compiled code, for example {{- &#8230; -}} or {{%- &#8230; -%}}</p></li></ul><div><hr></div><h3>Jinja within models</h3><p>Within models, you can use Jinja for injecting variables, environment-based logic, and references, before dbt runs the model. Jinja is processed at compile time, so you can use &#8220;dbt compile&#8221; to ensure that your code is compiling correctly.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="/__u/substackcdn.com/image/fetch/$s_!sURC!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F329197a9-69e7-470a-9d9c-1c61033d78a4_955x324.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="/__u/substackcdn.com/image/fetch/$s_!sURC!, /__u/andrealeonel.substack.com/w_424, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F329197a9-69e7-470a-9d9c-1c61033d78a4_955x324.png 424w, /__u/substackcdn.com/image/fetch/$s_!sURC!, /__u/andrealeonel.substack.com/w_848, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F329197a9-69e7-470a-9d9c-1c61033d78a4_955x324.png 848w, /__u/substackcdn.com/image/fetch/$s_!sURC!, /__u/andrealeonel.substack.com/w_1272, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F329197a9-69e7-470a-9d9c-1c61033d78a4_955x324.png 1272w, /__u/substackcdn.com/image/fetch/$s_!sURC!, /__u/andrealeonel.substack.com/w_1456, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F329197a9-69e7-470a-9d9c-1c61033d78a4_955x324.png 1456w" sizes="100vw"><img src="/__u/substackcdn.com/image/fetch/$s_!sURC!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F329197a9-69e7-470a-9d9c-1c61033d78a4_955x324.png" width="955" height="324" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/329197a9-69e7-470a-9d9c-1c61033d78a4_955x324.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:324,&quot;width&quot;:955,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:27367,&quot;alt&quot;:&quot;&quot;,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://andrealeonel.substack.com/i/178114177?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F329197a9-69e7-470a-9d9c-1c61033d78a4_955x324.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" title="" srcset="/__u/substackcdn.com/image/fetch/$s_!sURC!, /__u/andrealeonel.substack.com/w_424, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F329197a9-69e7-470a-9d9c-1c61033d78a4_955x324.png 424w, /__u/substackcdn.com/image/fetch/$s_!sURC!, /__u/andrealeonel.substack.com/w_848, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F329197a9-69e7-470a-9d9c-1c61033d78a4_955x324.png 848w, /__u/substackcdn.com/image/fetch/$s_!sURC!, /__u/andrealeonel.substack.com/w_1272, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F329197a9-69e7-470a-9d9c-1c61033d78a4_955x324.png 1272w, /__u/substackcdn.com/image/fetch/$s_!sURC!, /__u/andrealeonel.substack.com/w_1456, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F329197a9-69e7-470a-9d9c-1c61033d78a4_955x324.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption">Example of Jinja being used in a SQL model. Source: ChatGPT</figcaption></figure></div><div><hr></div><h3>Jinja within macros</h3><p>Macros are the dbt equivalent of functions. Macros are defined in SQL files stored in the &#8220;macros&#8221; directory or any other directory defined in &#8220;macros-paths&#8221;.</p><p>They use Jinja to create reusable code to be used across multiple models.</p><h4>Defining and using macros</h4><p>This is how a macro would be defined. A file can contain more than one macro:</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="/__u/substackcdn.com/image/fetch/$s_!jJeZ!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcda8ec54-c5eb-49f2-a78d-a8f988b12026_999x253.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="/__u/substackcdn.com/image/fetch/$s_!jJeZ!, /__u/andrealeonel.substack.com/w_424, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcda8ec54-c5eb-49f2-a78d-a8f988b12026_999x253.png 424w, /__u/substackcdn.com/image/fetch/$s_!jJeZ!, /__u/andrealeonel.substack.com/w_848, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcda8ec54-c5eb-49f2-a78d-a8f988b12026_999x253.png 848w, /__u/substackcdn.com/image/fetch/$s_!jJeZ!, /__u/andrealeonel.substack.com/w_1272, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcda8ec54-c5eb-49f2-a78d-a8f988b12026_999x253.png 1272w, /__u/substackcdn.com/image/fetch/$s_!jJeZ!, /__u/andrealeonel.substack.com/w_1456, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcda8ec54-c5eb-49f2-a78d-a8f988b12026_999x253.png 1456w" sizes="100vw"><img src="/__u/substackcdn.com/image/fetch/$s_!jJeZ!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcda8ec54-c5eb-49f2-a78d-a8f988b12026_999x253.png" width="999" height="253" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/cda8ec54-c5eb-49f2-a78d-a8f988b12026_999x253.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:253,&quot;width&quot;:999,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:26982,&quot;alt&quot;:&quot;&quot;,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://andrealeonel.substack.com/i/178114177?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcda8ec54-c5eb-49f2-a78d-a8f988b12026_999x253.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" title="" srcset="/__u/substackcdn.com/image/fetch/$s_!jJeZ!, /__u/andrealeonel.substack.com/w_424, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcda8ec54-c5eb-49f2-a78d-a8f988b12026_999x253.png 424w, /__u/substackcdn.com/image/fetch/$s_!jJeZ!, /__u/andrealeonel.substack.com/w_848, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcda8ec54-c5eb-49f2-a78d-a8f988b12026_999x253.png 848w, /__u/substackcdn.com/image/fetch/$s_!jJeZ!, /__u/andrealeonel.substack.com/w_1272, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcda8ec54-c5eb-49f2-a78d-a8f988b12026_999x253.png 1272w, /__u/substackcdn.com/image/fetch/$s_!jJeZ!, /__u/andrealeonel.substack.com/w_1456, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcda8ec54-c5eb-49f2-a78d-a8f988b12026_999x253.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption">Defining a macro. Source: <a href="https://docs.getdbt.com/docs/build/jinja-macros">Jinja &amp; Macros documentation</a></figcaption></figure></div><p>You can then use it as a function in the SQL model, entering any necessary arguments:</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="/__u/substackcdn.com/image/fetch/$s_!FrwO!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F390f4bd6-b0c0-4926-9450-a32021624476_999x288.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="/__u/substackcdn.com/image/fetch/$s_!FrwO!, /__u/andrealeonel.substack.com/w_424, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F390f4bd6-b0c0-4926-9450-a32021624476_999x288.png 424w, /__u/substackcdn.com/image/fetch/$s_!FrwO!, /__u/andrealeonel.substack.com/w_848, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F390f4bd6-b0c0-4926-9450-a32021624476_999x288.png 848w, /__u/substackcdn.com/image/fetch/$s_!FrwO!, /__u/andrealeonel.substack.com/w_1272, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F390f4bd6-b0c0-4926-9450-a32021624476_999x288.png 1272w, /__u/substackcdn.com/image/fetch/$s_!FrwO!, /__u/andrealeonel.substack.com/w_1456, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F390f4bd6-b0c0-4926-9450-a32021624476_999x288.png 1456w" sizes="100vw"><img src="/__u/substackcdn.com/image/fetch/$s_!FrwO!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F390f4bd6-b0c0-4926-9450-a32021624476_999x288.png" width="999" height="288" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/390f4bd6-b0c0-4926-9450-a32021624476_999x288.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:288,&quot;width&quot;:999,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:23669,&quot;alt&quot;:&quot;&quot;,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://andrealeonel.substack.com/i/178114177?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F390f4bd6-b0c0-4926-9450-a32021624476_999x288.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" title="" srcset="/__u/substackcdn.com/image/fetch/$s_!FrwO!, /__u/andrealeonel.substack.com/w_424, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F390f4bd6-b0c0-4926-9450-a32021624476_999x288.png 424w, /__u/substackcdn.com/image/fetch/$s_!FrwO!, /__u/andrealeonel.substack.com/w_848, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F390f4bd6-b0c0-4926-9450-a32021624476_999x288.png 848w, /__u/substackcdn.com/image/fetch/$s_!FrwO!, /__u/andrealeonel.substack.com/w_1272, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F390f4bd6-b0c0-4926-9450-a32021624476_999x288.png 1272w, /__u/substackcdn.com/image/fetch/$s_!FrwO!, /__u/andrealeonel.substack.com/w_1456, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F390f4bd6-b0c0-4926-9450-a32021624476_999x288.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption">A model calling the macro. Source: <a href="https://docs.getdbt.com/docs/build/jinja-macros">Jinja &amp; Macros documentation</a></figcaption></figure></div><p>Finally, this is what the compiled code would look like:</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="/__u/substackcdn.com/image/fetch/$s_!5UOc!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fee8845b2-e06b-480f-9dd1-855b7015d506_1002x255.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="/__u/substackcdn.com/image/fetch/$s_!5UOc!, /__u/andrealeonel.substack.com/w_424, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fee8845b2-e06b-480f-9dd1-855b7015d506_1002x255.png 424w, /__u/substackcdn.com/image/fetch/$s_!5UOc!, /__u/andrealeonel.substack.com/w_848, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fee8845b2-e06b-480f-9dd1-855b7015d506_1002x255.png 848w, /__u/substackcdn.com/image/fetch/$s_!5UOc!, /__u/andrealeonel.substack.com/w_1272, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fee8845b2-e06b-480f-9dd1-855b7015d506_1002x255.png 1272w, /__u/substackcdn.com/image/fetch/$s_!5UOc!, /__u/andrealeonel.substack.com/w_1456, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fee8845b2-e06b-480f-9dd1-855b7015d506_1002x255.png 1456w" sizes="100vw"><img src="/__u/substackcdn.com/image/fetch/$s_!5UOc!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fee8845b2-e06b-480f-9dd1-855b7015d506_1002x255.png" width="1002" height="255" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/ee8845b2-e06b-480f-9dd1-855b7015d506_1002x255.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:255,&quot;width&quot;:1002,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:24081,&quot;alt&quot;:&quot;&quot;,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://andrealeonel.substack.com/i/178114177?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fee8845b2-e06b-480f-9dd1-855b7015d506_1002x255.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" title="" srcset="/__u/substackcdn.com/image/fetch/$s_!5UOc!, /__u/andrealeonel.substack.com/w_424, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fee8845b2-e06b-480f-9dd1-855b7015d506_1002x255.png 424w, /__u/substackcdn.com/image/fetch/$s_!5UOc!, /__u/andrealeonel.substack.com/w_848, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fee8845b2-e06b-480f-9dd1-855b7015d506_1002x255.png 848w, /__u/substackcdn.com/image/fetch/$s_!5UOc!, /__u/andrealeonel.substack.com/w_1272, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fee8845b2-e06b-480f-9dd1-855b7015d506_1002x255.png 1272w, /__u/substackcdn.com/image/fetch/$s_!5UOc!, /__u/andrealeonel.substack.com/w_1456, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fee8845b2-e06b-480f-9dd1-855b7015d506_1002x255.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption">The compiled code containing the macro. Source: <a href="https://docs.getdbt.com/docs/build/jinja-macros">Jinja &amp; Macros documentation</a></figcaption></figure></div><h4>Macros properties</h4><p>Macros are not a resource like models, seeds, and snapshots. However, dbt allows them certain properties for documentation purposes.</p><p>Macro properties can only be defined in a properties.yml file stored within the &#8220;macros&#8221; subdirectory.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="/__u/substackcdn.com/image/fetch/$s_!kRA9!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7353a89f-e3d0-4e58-8cff-7cce2dc83306_994x586.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="/__u/substackcdn.com/image/fetch/$s_!kRA9!, /__u/andrealeonel.substack.com/w_424, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7353a89f-e3d0-4e58-8cff-7cce2dc83306_994x586.png 424w, /__u/substackcdn.com/image/fetch/$s_!kRA9!, /__u/andrealeonel.substack.com/w_848, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7353a89f-e3d0-4e58-8cff-7cce2dc83306_994x586.png 848w, /__u/substackcdn.com/image/fetch/$s_!kRA9!, /__u/andrealeonel.substack.com/w_1272, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7353a89f-e3d0-4e58-8cff-7cce2dc83306_994x586.png 1272w, /__u/substackcdn.com/image/fetch/$s_!kRA9!, /__u/andrealeonel.substack.com/w_1456, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_webp, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7353a89f-e3d0-4e58-8cff-7cce2dc83306_994x586.png 1456w" sizes="100vw"><img src="/__u/substackcdn.com/image/fetch/$s_!kRA9!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7353a89f-e3d0-4e58-8cff-7cce2dc83306_994x586.png" width="994" height="586" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/7353a89f-e3d0-4e58-8cff-7cce2dc83306_994x586.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:586,&quot;width&quot;:994,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:63312,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://andrealeonel.substack.com/i/178114177?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7353a89f-e3d0-4e58-8cff-7cce2dc83306_994x586.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="/__u/substackcdn.com/image/fetch/$s_!kRA9!, /__u/andrealeonel.substack.com/w_424, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7353a89f-e3d0-4e58-8cff-7cce2dc83306_994x586.png 424w, /__u/substackcdn.com/image/fetch/$s_!kRA9!, /__u/andrealeonel.substack.com/w_848, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7353a89f-e3d0-4e58-8cff-7cce2dc83306_994x586.png 848w, /__u/substackcdn.com/image/fetch/$s_!kRA9!, /__u/andrealeonel.substack.com/w_1272, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7353a89f-e3d0-4e58-8cff-7cce2dc83306_994x586.png 1272w, /__u/substackcdn.com/image/fetch/$s_!kRA9!, /__u/andrealeonel.substack.com/w_1456, /__u/andrealeonel.substack.com/c_limit, /__u/andrealeonel.substack.com/f_auto, /__u/andrealeonel.substack.com/q_auto:good, /__u/andrealeonel.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7353a89f-e3d0-4e58-8cff-7cce2dc83306_994x586.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption">Source: <a href="https://docs.getdbt.com/reference/macro-properties">macro properties documentation</a></figcaption></figure></div><ul><li><p>name (required): must match the name of the macro file.</p></li><li><p>description (optional): a string that describes the macro for dbt Docs</p></li><li><p>docs (optional): shows or hides macros from dbt Docs</p></li><li><p>arguments (optional): defines the arguments the macro accepts - again, for documentation purposes only, it does not affect how the macro runs.</p></li></ul><div><hr></div><h3>Best practices for Jinja &amp; Macros</h3><h4>Readability vs. reusability</h4><p>It&#8217;s important to strike a balance between reusable code and readability. Too much Jinja in the model can make it hard for others to read.</p><h4>Variables</h4><p>Set the variables at the top of the macro/model.</p>]]></content:encoded></item></channel></rss>