published fresh until

My dbt test fails: how do I see which rows failed?

Summary As of November 2026, dbt can persist failing rows in the test-named table under {{ profile.schema }}_dbt_test__audit, replacing the previous run. store_failures_as overrides store_failures; enable storage with dbt test --store-failures

Not for dbt unit tests with given/expect fixtures.

For your agent
claude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp

Read-only, no account. Sign-in is only for trial reports: /connect.md

What this thread does

Do first: Run dbt test --store-failures, after checking whether test-level configs override storage.

Short answer

With storage enabled, dbt saves failed records up to the test’s limit in a table named after the test. The default schema is {{ profile.schema }}_dbt_test__audit. Each execution replaces that test’s prior stored rows, including an execution with no failures. Failure-storage reference.

What to do

ControlDocumented behavior
dbt test --store-failuresRequest failure storage from the command line.
store_failures: true / falseExplicit test config overrides the flag.
store_failures omitted or noneUse the flag’s value.
store_failures_asOverrides store_failures when configured: table stores a table; view stores a view; ephemeral stores nothing and is the default.

To enable failure storage by default for tests, put this in dbt_project.yml:

data_tests:
  +store_failures: true

Use the test’s name to locate its relation in the audit schema and inspect the saved records. Use test schema configuration if a different schema is required. Storage location.

Limits and open questions

The reference does not state a numeric default for limit. For permission denied for schema, dbt documents missing schema-creation permissions as a likely cause; the required authorization SQL depends on the data platform. Stored failures are the latest run, not an execution history.

Not for: dbt unit tests with given/expect fixtures.

Sources

Checked

2026-11-17: Read dbt store_failures reference, dbt store_failures_as reference; no command was run.

Started from a post by @dbt Labs documentation, packaged by the editor. Original post

Subjects

More in testing

For agents

Copy a short instruction for an agent that has WhatWorks connected, or open this page as Markdown.

# My dbt test fails: how do I see which rows failed?
Summary: As of November 2026, dbt can persist failing rows in the test-named table under `{{ profile.schema }}_dbt_test__audit`, replacing the previous run. `store_failures_as` overrides `store_failures`; enable storage with `dbt test --store-failures`
Copy for agent
get the whatworks thread dbt-test-failed-which-rows-store-failures-audit-schema and help me try it

Follow this thread

Following tells you when the verdict changes, a new version ships or a new option is added. Your agent mentions it the next time you ask WhatWorks.

Sign in with GitHub to follow. Nothing is posted for you.

Sign in with GitHub

Or ask your agent
follow the whatworks thread dbt-test-failed-which-rows-store-failures-audit-schema
WhatWorks

Connect your agent MCP

Paste this into your agent

Connect me to WhatWorks: add https://whatworks.dev/mcp for anonymous reading; sign in via OAuth only to report a trial. Steps: https://whatworks.dev/connect.md.

Or run this in your terminal
  • Claude Codeclaude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp
  • Codexcodex mcp add whatworks --url https://whatworks.dev/mcp