Skip to content

Add compiled_sql and relation_name(audit_table_name) in Test_Executions, stg_dbt__test_executions, fct_dbt__test_executions - #539

Merged
mtcarlone merged 15 commits into
brooklyn-data:mainfrom
sagark246:fix/add_more_to_test_executions
Nov 6, 2026
Merged

mtcarlone merged 15 commits into
brooklyn-data:mainfrom
sagark246:fix/add_more_to_test_executions

Conversation

@sagark246

@sagark246 sagark246 commented Jan 23, 2026 •

Copy link
Copy Markdown
Contributor

Overview

  • Include additional metadata to test_executions model from results and also carry forward to staging and fact tables for the same.

Update type - breaking / non-breaking

  • Minor bug fix
  • Documentation improvements
  • Quality of Life improvements
  • New features (non-breaking change)
  • New features (breaking change)
  • Other (non-breaking change)
  • Other (breaking change)
  • Release preparation

What does this solve?

Current Scenario: We don't have these two columns in the test_executions model.
Columns:

  • compiled_code
  • relation_name
image

below is the snippet from results.json, highlighting the missing column from
image

Outstanding questions

  • Inorder to test for other databases, not sure if should change other macros apart from
    bigquery__get_test_executions_dml_sql or should i fix default__get_test_executions_dml_sql

What databases have you tested with?

  • Snowflake
  • Google BigQuery
  • Databricks
  • Spark
  • N/A

@sagark246

Copy link
Copy Markdown
Contributor Author

Hi Team,

This is my first contribution, I went through contribution.md.
Let me know if there's anything improper.

@sagark246

Copy link
Copy Markdown
Contributor Author

@mtcarlone

can you please review this PR.
let me know if this change is helpful or please advise on the correct way to fix it ?

@sagark246

Copy link
Copy Markdown
Contributor Author

@sp-tkerlavage

please review this additional columns if they are helpful.

@mtcarlone mtcarlone added this to the Jan 2026 Release milestone Jan 28, 2026
@sagark246
sagark246 had a problem deploying to Approve Integration Tests February 5, 2026 06:43 — with GitHub Actions Failure
@sagark246
sagark246 had a problem deploying to Approve Integration Tests February 5, 2026 06:43 — with GitHub Actions Failure
@sagark246
sagark246 had a problem deploying to Approve Integration Tests February 5, 2026 06:43 — with GitHub Actions Failure
@sagark246
sagark246 had a problem deploying to Approve Integration Tests February 5, 2026 06:43 — with GitHub Actions Failure
@sagark246
sagark246 had a problem deploying to Approve Integration Tests February 5, 2026 06:43 — with GitHub Actions Failure
@sagark246
sagark246 had a problem deploying to Approve Integration Tests February 5, 2026 06:43 — with GitHub Actions Failure
@sagark246
sagark246 had a problem deploying to Approve Integration Tests February 5, 2026 06:43 — with GitHub Actions Failure
@sagark246
sagark246 had a problem deploying to Approve Integration Tests February 5, 2026 06:43 — with GitHub Actions Failure
@sagark246
sagark246 had a problem deploying to Approve Integration Tests February 5, 2026 06:43 — with GitHub Actions Failure
@sagark246
sagark246 had a problem deploying to Approve Integration Tests February 5, 2026 06:43 — with GitHub Actions Failure
@mtcarlone

Copy link
Copy Markdown
Contributor

@sagark246 can you merge main back into this and I'll ready it for a release in the next few weeks. CI has been updated to be more reliable

sagark246 and others added 8 commits August 4, 2026 11:19
The PR added the two columns only to the BigQuery upload macro, so the
Default, Snowflake, Postgres/DuckDB, SQL Server and Trino inserts sent 13
values into 15 columns and the on-run-end hook failed on those adapters.
Append both last in every override, as plain strings or real nulls.

compiled_sql is varchar(max) on SQL Server (new type_long_string helper),
where the string type is varchar(8000) and a longer test would fail the
insert. dbt_artifacts_exclude_compiled_sql leaves it out. test_executions
gets a 100-row default batch on BigQuery and Trino, since compiled SQL
makes each row larger.
A unique test now stores failures, and long_compiled_test compiles to over
9,000 characters with a quote, a backslash and newlines. The new singular
test checks the previous build's rows: compiled_sql is present and whole
for every test that ran, and audit_table_name is set only for tests that
store failures.
Fusion leaves node.compiled_code empty on run results and sets
result.compiled_code instead, so compiled_sql was null for every test.
Fall back to it; on dbt Core it's undefined and node.compiled_code wins.
@mtcarlone
mtcarlone merged commit 318ccc6 into brooklyn-data:main Nov 6, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants