Make extension-column unit tests hermetic re: passthrough prefix (#1348)#1350
Open
gopidaxhealthcaresolutions wants to merge 2 commits into
Conversation
…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.
✅ Deploy Preview for thetuvaproject canceled.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #1348
Problem
The unit tests in
models/core/extension_column_unit_tests.ymlhardcodex_-prefixed columns (e.g.x_temp_person_id).select_extension_columns()only emits columns matching the configuredpassthrough.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:Reproduce: set
passthrough.prefix: 'ext_'indbt_project.ymland run the tests.Fix
Pin the passthrough configuration inside each test's
overrides.varsso the tests are hermetic — self-contained and independent of the consuming project's config: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 thestrip: truecase (see #1347).Testing
Ran both unit tests locally on DuckDB:
--vars '{passthrough: {prefix: "ext_", strip: true}}'): both still PASS, because the in-testoverrides.varspin takes precedence — this is the exact scenario reported as broken.