-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add option to use most recently created / updated model (#19)
* Modularise ref macro * Enable selection of last updated table, modularise macro * Add prefer_recent tests * Add prefer_recent docs * Apply singular tests fix * Bump version * Fix whitespace * Clarify prefer_recent support
- Loading branch information
1 parent
d9ee967
commit b04fd47
Showing
42 changed files
with
546 additions
and
137 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
11 changes: 11 additions & 0 deletions
11
integration_tests/_template/models/production/dev_newer.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,11 @@ | ||
select | ||
source_target, | ||
source_database, | ||
source_schema, | ||
source_model, | ||
'{{ target.name }}' as this_target, | ||
'{{ this.database }}' as this_database, | ||
'{{ this.schema }}' as this_schema, | ||
'{{ this.name }}' as this_model | ||
from | ||
{{ ref('stg__dev_newer') }} |
5 changes: 5 additions & 0 deletions
5
integration_tests/_template/models/staging/stg__dev_newer.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,5 @@ | ||
select | ||
'{{ target.name }}' as source_target, | ||
'{{ this.database }}' as source_database, | ||
'{{ this.schema }}' as source_schema, | ||
'{{ this.name }}' as source_model |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
select | ||
source_target, | ||
source_database, | ||
source_schema, | ||
source_model, | ||
'{{ target.name }}' as this_target, | ||
'{{ this.database }}' as this_database, | ||
'{{ this.schema }}' as this_schema, | ||
'{{ this.name }}' as this_model | ||
from | ||
{{ ref('stg__dev_newer') }} |
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,5 @@ | ||
select | ||
'{{ target.name }}' as source_target, | ||
'{{ this.database }}' as source_database, | ||
'{{ this.schema }}' as source_schema, | ||
'{{ this.name }}' as source_model |
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
11 changes: 11 additions & 0 deletions
11
integration_tests/dev_db_dev_sch/models/production/dev_newer.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,11 @@ | ||
select | ||
source_target, | ||
source_database, | ||
source_schema, | ||
source_model, | ||
'{{ target.name }}' as this_target, | ||
'{{ this.database }}' as this_database, | ||
'{{ this.schema }}' as this_schema, | ||
'{{ this.name }}' as this_model | ||
from | ||
{{ ref('stg__dev_newer') }} |
5 changes: 5 additions & 0 deletions
5
integration_tests/dev_db_dev_sch/models/staging/stg__dev_newer.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,5 @@ | ||
select | ||
'{{ target.name }}' as source_target, | ||
'{{ this.database }}' as source_database, | ||
'{{ this.schema }}' as source_schema, | ||
'{{ this.name }}' as source_model |
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
11 changes: 11 additions & 0 deletions
11
integration_tests/dev_db_env_sch/models/production/dev_newer.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,11 @@ | ||
select | ||
source_target, | ||
source_database, | ||
source_schema, | ||
source_model, | ||
'{{ target.name }}' as this_target, | ||
'{{ this.database }}' as this_database, | ||
'{{ this.schema }}' as this_schema, | ||
'{{ this.name }}' as this_model | ||
from | ||
{{ ref('stg__dev_newer') }} |
5 changes: 5 additions & 0 deletions
5
integration_tests/dev_db_env_sch/models/staging/stg__dev_newer.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,5 @@ | ||
select | ||
'{{ target.name }}' as source_target, | ||
'{{ this.database }}' as source_database, | ||
'{{ this.schema }}' as source_schema, | ||
'{{ this.name }}' as source_model |
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 |
---|---|---|
|
@@ -22,3 +22,4 @@ models: | |
vars: | ||
upstream_prod_schema: prod | ||
upstream_prod_fallback: true | ||
upstream_prod_prefer_recent: true |
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
Oops, something went wrong.