-
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.
Fix tests to ignore rollbacks for bq, fix redshift tests
Trim down the "target" context value to use the opt-in connection_info Make sure it contains a superset of the documented stuff Make sure it does not contain any blacklisted items Change some asserts to raise InternalExceptions because assert error messages are bad
- Loading branch information
Jacob Beck
committed
Oct 25, 2019
1 parent
542a053
commit 82bd794
Showing
14 changed files
with
118 additions
and
31 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
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
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 |
---|---|---|
@@ -1,3 +1,33 @@ | ||
{% set blacklist = ['pass', 'password', 'keyfile', 'keyfile.json', 'password', 'private_key_passphrase'] %} | ||
{% for key in blacklist %} | ||
{% if key in blacklist and blacklist[key] %} | ||
{% do exceptions.raise_compiler_error('invalid target, found banned key "' ~ key ~ '"') %} | ||
{% endif %} | ||
{% endfor %} | ||
|
||
{% if 'type' not in target %} | ||
{% do exceptions.raise_compiler_error('invalid target, missing "type"') %} | ||
{% endif %} | ||
|
||
{% set required = ['name', 'schema', 'type', 'threads'] %} | ||
|
||
{# Require what we docuement at https://docs.getdbt.com/docs/target #} | ||
{% if target.type == 'postgres' or target.type == 'redshift' %} | ||
{% do required.extend(['dbname', 'host', 'user', 'port']) %} | ||
{% elif target.type == 'snowflake' %} | ||
{% do required.extend(['database', 'warehouse', 'user', 'role', 'account']) %} | ||
{% elif target.type == 'bigquery' %} | ||
{% do required.extend(['project']) %} | ||
{% else %} | ||
{% do exceptions.raise_compiler_error('invalid target, got unknown type "' ~ target.type ~ '"') %} | ||
|
||
{% endif %} | ||
|
||
{% for value in required %} | ||
{% if value not in target %} | ||
{% do exceptions.raise_compiler_error('invalid target, missing "' ~ value ~ '"') %} | ||
{% endif %} | ||
{% endfor %} | ||
|
||
{% do run_query('select 2 as inner_id') %} | ||
select 1 as outer_id |
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