From cbe9410714d2e55c56a79318abd7590e238f9748 Mon Sep 17 00:00:00 2001 From: Doug Beatty Date: Thu, 4 Apr 2024 14:22:25 -0600 Subject: [PATCH] Add `sql_header` to data tests --- .../global_project/macros/materializations/tests/helpers.sql | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/dbt/include/global_project/macros/materializations/tests/helpers.sql b/dbt/include/global_project/macros/materializations/tests/helpers.sql index ead727d9..fec85e38 100644 --- a/dbt/include/global_project/macros/materializations/tests/helpers.sql +++ b/dbt/include/global_project/macros/materializations/tests/helpers.sql @@ -3,6 +3,10 @@ {%- endmacro %} {% macro default__get_test_sql(main_sql, fail_calc, warn_if, error_if, limit) -%} + {%- set sql_header = config.get('sql_header', none) -%} + + {{ sql_header if sql_header is not none }} + select {{ fail_calc }} as failures, {{ fail_calc }} {{ warn_if }} as should_warn,