-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
- Loading branch information
Showing
17 changed files
with
740 additions
and
969 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
version = "1.8.8" | ||
version = "1.8.9" |
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
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
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
36 changes: 28 additions & 8 deletions
36
dbt/include/fabric/macros/materializations/tests/helpers.sql
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 |
---|---|---|
@@ -1,12 +1,32 @@ | ||
{% macro fabric__get_test_sql(main_sql, fail_calc, warn_if, error_if, limit) -%} | ||
{% macro get_fabric_test_sql(database, schema, main_sql, fail_calc, warn_if, error_if, limit) -%} | ||
|
||
With dbt_internal_test AS ( | ||
{{ main_sql }} | ||
) | ||
{% set testview %} | ||
[{{ schema }}.testview_{{ range(1300, 19000) | random }}] | ||
{% endset %} | ||
|
||
{% set sql = main_sql.replace("'", "''")%} | ||
{{ get_use_database_sql(database) }} | ||
EXEC('create view {{testview}} as {{ sql }};') | ||
select | ||
COUNT(*) AS failures, | ||
CASE WHEN COUNT(*) != 0 THEN 'true' ELSE 'false' END AS should_warn, | ||
CASE WHEN COUNT(*) != 0 THEN 'true' ELSE 'false' END AS should_error | ||
FROM dbt_internal_test | ||
{{ fail_calc }} as failures, | ||
case when {{ fail_calc }} {{ warn_if }} | ||
then 'true' else 'false' end as should_warn, | ||
case when {{ fail_calc }} {{ error_if }} | ||
then 'true' else 'false' end as should_error | ||
from ( | ||
select {{ "top (" ~ limit ~ ')' if limit != none }} * from {{testview}} | ||
) dbt_internal_test; | ||
|
||
{{ get_use_database_sql(database) }} | ||
EXEC('drop view {{testview}};') | ||
{%- endmacro %} | ||
|
||
{% macro fabric__generate_schema_name(custom_schema_name, node) -%} | ||
|
||
{%- set default_schema = target.schema -%} | ||
{%- if custom_schema_name is none -%} | ||
{{ default_schema }} | ||
{%- else -%} | ||
{{ custom_schema_name | trim }} | ||
{%- endif -%} | ||
{%- endmacro %} |
Oops, something went wrong.