-
Notifications
You must be signed in to change notification settings - Fork 117
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
169 additions
and
51 deletions.
There are no files selected for viewing
This file contains 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
28 changes: 28 additions & 0 deletions
28
tests/integration/adapter/clickhouse/test_clickhouse_sql_header.py
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import pytest | ||
from dbt.tests.util import run_dbt_and_capture | ||
|
||
my_model_sql_header_sql = """ | ||
{{ | ||
config( | ||
materialized = "table", | ||
) | ||
}} | ||
{% call set_sql_header(config) %} | ||
set log_comment = 'TEST_LOG_COMMENT'; | ||
{%- endcall %} | ||
select getSettings('log_comment') as column_name | ||
""" | ||
|
||
|
||
class TestSQLHeader: | ||
@pytest.fixture(scope="class") | ||
def models(self): | ||
return { | ||
"my_model_sql_header.sql": my_model_sql_header_sql, | ||
} | ||
|
||
def test__sql_header(self, project): | ||
_, log_output = run_dbt_and_capture(["run", "-s", "my_model_sql_header"], expect_pass=False) | ||
|
||
assert 'Multi-statements' in log_output |
This file contains 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
This file contains 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