-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Quote config #742
Quote config #742
Changes from 8 commits
9fe9ca8
a0dedfa
9a635ca
4a550e5
ba58e7e
2f54e52
1c61341
396ea65
852a0eb
5bafcd6
ac62a4d
8ee8e76
dd707c8
e269c25
8cc3696
a661512
41aa908
126ab23
e564dee
d33ec80
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -175,6 +175,7 @@ def invoke_dbt(parsed): | |
profile_to_load=parsed.profile, | ||
args=parsed | ||
) | ||
proj.log_warnings() | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. we should do this check on line 235. If |
||
proj.validate() | ||
except project.DbtProjectError as e: | ||
logger.info("Encountered an error while reading the project:") | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -91,6 +91,9 @@ def __init__(self, cfg, profiles, profiles_dir, profile_to_load=None, | |
if self.cfg.get('models') is None: | ||
self.cfg['models'] = {} | ||
|
||
if self.cfg.get('quoting') is None: | ||
self.cfg['quoting'] = {} | ||
|
||
if self.cfg['models'].get('vars') is None: | ||
self.cfg['models']['vars'] = {} | ||
|
||
|
@@ -223,6 +226,21 @@ def validate(self): | |
"Expected project configuration '{}' was not supplied" | ||
.format('.'.join(e.path)), self) | ||
|
||
def log_warnings(self): | ||
target_cfg = self.run_environment() | ||
db_type = target_cfg.get('type') | ||
|
||
if db_type == 'snowflake' and self.cfg \ | ||
.get('quoting', {}) \ | ||
.get('identifier') is None: | ||
logger.warn( | ||
'You are using Snowflake, but you did not specify a ' | ||
'quoting strategy for your identifiers. Quoting ' | ||
'behavior for Snowflake will change in a future release, ' | ||
'so it is recommended that you define this explicitly. ' | ||
'\n\n' | ||
'For more information, see ADD LINK') | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. TODO |
||
|
||
def hashed_name(self): | ||
if self.cfg.get("name", None) is None: | ||
return None | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,6 +28,7 @@ | |
'vars', | ||
'column_types', | ||
'bind', | ||
'quoting', | ||
] | ||
|
||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,4 +6,4 @@ | |
) | ||
}} | ||
|
||
select * from {{ target.schema }}.seed | ||
select * from {{ ref('seed') }} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,4 +5,4 @@ | |
) | ||
}} | ||
|
||
select * from {{ target.schema }}.seed | ||
select * from {{ ref('seed') }} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,4 +5,4 @@ | |
) | ||
}} | ||
|
||
select * from {{ target.schema }}.seed | ||
select * from {{ ref('seed') }} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,4 +6,4 @@ | |
) | ||
}} | ||
|
||
select * from {{ target.schema }}.seed | ||
select * from {{ ref('seed') }} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,4 +5,4 @@ | |
}} | ||
|
||
-- this is a unicode character: å | ||
select * from {{ target.schema }}.seed | ||
select * from {{ ref('seed') }} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,4 +4,4 @@ | |
) | ||
}} | ||
|
||
select * from {{ target.schema }}.seed | ||
select * from {{ ref('seed') }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should we quote both schema and identifier here? Feels weird to do one and not the other