Skip to content

Make extension-column unit tests hermetic re: passthrough prefix (#1348)#1350

Open
gopidaxhealthcaresolutions wants to merge 2 commits into
tuva-health:mainfrom
gopidaxhealthcaresolutions:fix/1348-extension-unit-tests-hardcode-prefix
Open

Make extension-column unit tests hermetic re: passthrough prefix (#1348)#1350
gopidaxhealthcaresolutions wants to merge 2 commits into
tuva-health:mainfrom
gopidaxhealthcaresolutions:fix/1348-extension-unit-tests-hardcode-prefix

Conversation

@gopidaxhealthcaresolutions

Copy link
Copy Markdown

Closes #1348

Problem

The unit tests in models/core/extension_column_unit_tests.yml hardcode x_-prefixed columns (e.g. x_temp_person_id). select_extension_columns() only emits columns matching the configured passthrough.prefix, so if a project sets a non-default prefix (e.g. ext_), those columns get filtered out of the model output while the test fixtures still expect them:

Invalid column name: 'x_temp_person_id' in unit test fixture for expected output.

Reproduce: set passthrough.prefix: 'ext_' in dbt_project.yml and run the tests.

Fix

Pin the passthrough configuration inside each test's overrides.vars so the tests are hermetic — self-contained and independent of the consuming project's config:

overrides:
  vars:
    passthrough:
      prefix: 'x_'
      strip: false
    _extension_columns_override: ['x_temp_person_id', 'x_temp_first_name']

This keeps the tests aligned with the x_-prefixed fixtures they already assert, regardless of what prefix/strip a project configures. It also makes them robust to the strip: true case (see #1347).

Testing

Ran both unit tests locally on DuckDB:

  • Default run: both PASS.
  • Simulating a project that overrides the prefix (--vars '{passthrough: {prefix: "ext_", strip: true}}'): both still PASS, because the in-test overrides.vars pin takes precedence — this is the exact scenario reported as broken.

…a-health#1348)

The unit tests in models/core/extension_column_unit_tests.yml hardcode
x_-prefixed columns (e.g. x_temp_person_id). select_extension_columns()
only emits columns matching the configured passthrough.prefix, so when a
project sets a non-default prefix (e.g. ext_) those columns are filtered
out and the tests fail with an invalid-column error on the expected output.

Pin passthrough.prefix (x_) and passthrough.strip (false) inside each
test's overrides.vars so the tests are self-contained and pass regardless
of the consuming project configuration, matching the fixtures they assert.
@netlify

netlify Bot commented Jun 22, 2026

Copy link
Copy Markdown

Deploy Preview for thetuvaproject canceled.

Name Link
🔨 Latest commit b5e77d0
🔍 Latest deploy log https://app.netlify.com/projects/thetuvaproject/deploys/6a4725be6bef9600085c76a3

@chase-jones chase-jones added bug Something isn't working community Issues created by community members labels Jul 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working community Issues created by community members

Projects

Status: 👀 Ready for Review

Development

Successfully merging this pull request may close these issues.

core__member_months extension-column unit tests hardcode the x_ prefix

2 participants