<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Mira Lund</title>
    <description>The latest articles on DEV Community by Mira Lund (@mira_lund).</description>
    <link>https://dev.to/mira_lund</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4215001%2F4170c212-17cb-4cac-a72e-63e4e3f78a4c.jpg</url>
      <title>DEV Community: Mira Lund</title>
      <link>https://dev.to/mira_lund</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/mira_lund"/>
    <language>en</language>
    <item>
      <title>The dbt test that would have caught our duplicate orders</title>
      <dc:creator>Mira Lund</dc:creator>
      <pubDate>Thu, 29 Oct 2026 10:22:25 +0000</pubDate>
      <link>https://dev.to/mira_lund/the-dbt-test-that-would-have-caught-our-duplicate-orders-3oc5</link>
      <guid>https://dev.to/mira_lund/the-dbt-test-that-would-have-caught-our-duplicate-orders-3oc5</guid>
      <description>&lt;p&gt;Six weeks of duplicate orders in a revenue dashboard, and the fix was a test we already knew how to write.&lt;/p&gt;

&lt;p&gt;What happened: our orders source table got a second feed during a migration. Both feeds used the same order id, so joins against order items fanned out and every affected order counted twice. Nobody noticed because the number went up slowly, and up looks like growth.&lt;/p&gt;

&lt;p&gt;The test that would have caught it on day one is boring: a uniqueness test on order_id in the staging model. Not on the mart, on staging, where the two feeds first meet. We had a uniqueness test on the mart's order_id, and it passed the whole time, because the mart aggregated before it duplicated.&lt;/p&gt;

&lt;p&gt;Two other rules I now apply:&lt;/p&gt;

&lt;p&gt;Tests belong at the first place two sources meet, not at the end of the pipeline.&lt;/p&gt;

&lt;p&gt;If a source gains a feed, the staging model needs a review, not just a backfill.&lt;/p&gt;

&lt;p&gt;The dashboard was never wrong about what it measured. It was measuring two versions of the same order.&lt;/p&gt;

</description>
      <category>dbt</category>
      <category>data</category>
      <category>sql</category>
    </item>
  </channel>
</rss>
