Repository navigation
Conversation
On T-SQL the test materialization stores each test result in a regular table in the elementary schema. It was never registered for cleanup, so one table per test stayed behind. The failed row count additionally copied the result into a timestamped table per failing test and run, also never dropped. - register the test result relation in temp_test_table_relations_map - with store_failures, reuse dbt's audit relation instead of a helper table, so store_failures_as=view keeps working after cleanup - read the failed row count from the already flat test SQL Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
This branch has not been deployed
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 #1109
Summary
On T-SQL the test materialization stores each test result in a regular table in the elementary schema, and the
failed row count copied it into another
<alias>__tmp_<ts>table. Neither was ever dropped.temp_test_table_relations_mapon T-SQL, so the existing on-run-endcleanup drops it.
store_failures, skip the helper table and pointsqlat dbt's audit relation after thematerialization (
use_stored_failures_as_test_sql). This keepsstore_failures_as: viewvalid after cleanup.fabric__/sqlserver__get_failed_row_count_calc_query. At that pointsqlis alreadyselect * from <helper relation>on T-SQL, so the default implementation applies.Non-T-SQL adapters are unaffected: registration is limited to
is_tsql(), and thestore_failuresbranch onlyapplies where the helper relation is used (
is_tsql()ortests_use_temp_tables).Verification
Fabric Data Warehouse, dbt-fabric 1.10.0post2, elementary schema in a different warehouse than
target.database. One model, six tests (unique,not_null,accepted_valueswithstore_failures_as: table,dbt_utils.unique_combination_of_columns,dbt_utils.expression_is_true,uniquewithstore_failures_as: view).masterdbt testfailed_row_countforunique(sum(n_records))Executed queries before / after:
Integration tests added in
integration_tests/tests/test_tsql_test_result_relations.py(fabric, sqlserver).I could not run them locally; they need the fork approval to run in CI.
🤖 Generated with Claude Code
Summary by CodeRabbit