-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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 #2711 from kconvey/kconvey-model-ttl
Support TTL for BigQuery tables
- Loading branch information
Showing
5 changed files
with
78 additions
and
2 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
1 change: 1 addition & 0 deletions
1
test/integration/022_bigquery_test/adapter-specific-models/expiring_table.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 @@ | ||
select 1 as id |
38 changes: 38 additions & 0 deletions
38
test/integration/022_bigquery_test/test_bigquery_adapter_specific.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,38 @@ | ||
""""Test adapter specific config options.""" | ||
from test.integration.base import DBTIntegrationTest, use_profile | ||
import textwrap | ||
import yaml | ||
|
||
|
||
class TestBigqueryAdapterSpecific(DBTIntegrationTest): | ||
|
||
@property | ||
def schema(self): | ||
return "bigquery_test_022" | ||
|
||
@property | ||
def models(self): | ||
return "adapter-specific-models" | ||
|
||
@property | ||
def profile_config(self): | ||
return self.bigquery_profile() | ||
|
||
@property | ||
def project_config(self): | ||
return yaml.safe_load(textwrap.dedent('''\ | ||
config-version: 2 | ||
models: | ||
test: | ||
materialized: table | ||
expiring_table: | ||
hours_to_expiration: 4 | ||
''')) | ||
|
||
@use_profile('bigquery') | ||
def test_bigquery_hours_to_expiration(self): | ||
_, stdout = self.run_dbt_and_capture(['--debug', 'run']) | ||
|
||
self.assertIn( | ||
'expiration_timestamp=TIMESTAMP_ADD(CURRENT_TIMESTAMP(), INTERVAL ' | ||
'4 hour)', stdout) |
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