-
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.
- Loading branch information
1 parent
39f92e5
commit 37e373a
Showing
7 changed files
with
66 additions
and
12 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
a,b | ||
1,2 | ||
2,4 | ||
3,6 |
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,4 @@ | ||
a,b | ||
6,2 | ||
12,4 | ||
18,6 |
4 changes: 4 additions & 0 deletions
4
test/integration/055_ref_override_test/macros/ref_override_macro.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,4 @@ | ||
-- Macro to override ref and always return the same result | ||
{% macro ref(modelname) %} | ||
{% do return(builtins.ref(modelname).replace_path(identifier='seed_2')) %} | ||
{% endmacro %} |
3 changes: 3 additions & 0 deletions
3
test/integration/055_ref_override_test/models/ref_override.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,3 @@ | ||
select | ||
* | ||
from {{ ref('seed_1') }} |
29 changes: 29 additions & 0 deletions
29
test/integration/055_ref_override_test/test_ref_override.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,29 @@ | ||
from test.integration.base import DBTIntegrationTest, use_profile | ||
|
||
|
||
class TestRefOverride(DBTIntegrationTest): | ||
@property | ||
def schema(self): | ||
return "dbt_ref_override_055" | ||
|
||
@property | ||
def project_config(self): | ||
return { | ||
'data-paths': ['data'], | ||
"macro-paths": ["macros"], | ||
'seeds': { | ||
'quote_columns': False | ||
} | ||
} | ||
|
||
@property | ||
def models(self): | ||
return "models" | ||
|
||
@use_profile('postgres') | ||
def test_postgres_ref_override(self): | ||
self.run_dbt(['seed']) | ||
self.run_dbt(['run']) | ||
# We want it to equal seed_2 and not seed_1. If it's | ||
# still pointing at seed_1 then the override hasn't worked. | ||
self.assertTablesEqual('ref_override', 'seed_2') |