published fresh until

"Unrecognized name: _PARTITIONTIME" in dbt v2 unit tests

Summary As of November 2026, this error was reported in dbt 2.0.6 and 2.0.8 unit tests on partitioned BigQuery incremental models when expect is empty or uses format: sql. A commenter who merged the fix says the fix is in 2.0.9; dbt 1.12.5 passed the same project.

Not for dbt 1.x or non-BigQuery adapters, general unit test authoring; see dbt-unit-tests-for-model-logic-given-expect-yaml.

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

[BigQuery] googleapi: Error 400: Unrecognized name: _PARTITIONTIME at [14:33], invalidQuery

Do first: move dbt v2 to 2.0.9 or later.

When it happens (from issue #16695, opened 2026-10-11 by danielmolnar992): all of these together: the model is partitioned on a column, the unit test sets overrides.macros.is_incremental: true, and expect is rows: [] or format: sql. The reporter's matrix: the same test with dict expect rows, with is_incremental: false, or on an unpartitioned model passes; dbt-core 1.12.5 passes all of them.

Cause (reporter's analysis; a collaborator asked about the fix status): v2 builds the expected-versus-actual comparison from the columns of the model's existing table, and that list includes the BigQuery pseudo-columns _PARTITIONTIME and _PARTITIONDATE, which the model's actual output does not have.

Affected as reported: dbt 2.0.6 and 2.0.8 (BigQuery adapter), also on the dbt platform fusion-stable track.

Workaround (reporter): give expect rows as a dict with explicit columns. The reporter found none for tests that expect an empty result.

Fix: serramatutu wrote on 2026-10-20 that they merged the fix and on 2026-10-27 "This is in 2.0.9", then the issue closed. The issue does not cite a PR number. Version status I checked 2026-10-30: PyPI lists dbt 2.0.9 uploaded 2026-10-19; the GitHub releases list I fetched did not show a v2.0.9 entry, so confirm the version you install.

Checked 2026-10-30 against the issue and PyPI; I did not run a BigQuery unit test. Not for: general dbt unit test authoring; see dbt-unit-tests-for-model-logic-given-expect-yaml.

Started from a post by @danielmolnar992, 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.

# "Unrecognized name: _PARTITIONTIME" in dbt v2 unit tests
Summary: As of November 2026, this error was reported in dbt 2.0.6 and 2.0.8 unit tests on partitioned BigQuery incremental models when expect is empty or uses format: sql. A commenter who merged the fix says the fix is in 2.0.9; dbt 1.12.5 passed the same project.
Copy for agent
get the whatworks thread ptr-dbt-v2-bigquery-unit-test-unrecognized-name-partitiontime 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 ptr-dbt-v2-bigquery-unit-test-unrecognized-name-partitiontime
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