-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1788 from fishtown-analytics/feature/warehouse-mo…
…del-config Add runtime per-model warehouse config on snowflake models (#1358)
- Loading branch information
Showing
10 changed files
with
177 additions
and
10 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
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
2 changes: 2 additions & 0 deletions
2
test/integration/050_warehouse_test/models/expected_warehouse.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 |
---|---|---|
@@ -0,0 +1,2 @@ | ||
{{ config(materialized='table') }} | ||
select 'DBT_TEST_ALT' as warehouse |
2 changes: 2 additions & 0 deletions
2
test/integration/050_warehouse_test/models/invalid_warehouse.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 |
---|---|---|
@@ -0,0 +1,2 @@ | ||
{{ config(warehouse='DBT_TEST_DOES_NOT_EXIST') }} | ||
select current_warehouse() as warehouse |
2 changes: 2 additions & 0 deletions
2
test/integration/050_warehouse_test/models/override_warehouse.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 |
---|---|---|
@@ -0,0 +1,2 @@ | ||
{{ config(warehouse='DBT_TEST_ALT', materialized='table') }} | ||
select current_warehouse() as warehouse |
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 @@ | ||
from test.integration.base import DBTIntegrationTest, use_profile | ||
import os | ||
|
||
|
||
class TestDebug(DBTIntegrationTest): | ||
@property | ||
def schema(self): | ||
return 'dbt_warehouse_050' | ||
|
||
@staticmethod | ||
def dir(value): | ||
return os.path.normpath(value) | ||
|
||
@property | ||
def models(self): | ||
return self.dir('models') | ||
|
||
@use_profile('snowflake') | ||
def test_snowflake_override_ok(self): | ||
self.run_dbt([ | ||
'run', | ||
'--models', 'override_warehouse', 'expected_warehouse', | ||
]) | ||
self.assertManyRelationsEqual([['OVERRIDE_WAREHOUSE'], ['EXPECTED_WAREHOUSE']]) | ||
|
||
@use_profile('snowflake') | ||
def test_snowflake_override_noexist(self): | ||
self.run_dbt(['run', '--models', 'invalid_warehouse'], expect_pass=False) |
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