-
Notifications
You must be signed in to change notification settings - Fork 178
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
[Bug] quoting
config not working with 1.8
#1074
Comments
I am experiencing something similar when quoting columns on sources. It appears to work on |
Do you have a cheeky repro? Unit tests are brand new in 1.8 so it's not really an apples to apples with this issue per se - which is a regression of the quoting config in 1.7 > 1.8. In any case, a quick sense check on: Core:
- installed: 1.8.3
- latest: 1.8.3 - Up to date!
Plugins:
- snowflake: 1.8.3 - Up to date! -- create table to test - reserved keyword as col name
create or replace table development_jyeo.dbt_jyeo.raw as (select 1 as "create"); # models/sources.yml
version: 2
sources:
- name: dbt_jyeo
tables:
- name: raw
columns:
- name: create
data_tests:
- not_null $ dbt --debug test
22:14:41 On test.my_dbt_project.source_not_null_dbt_jyeo_raw_create.f79610167c: /* {"app": "dbt", "dbt_version": "1.8.3", "profile_name": "all", "target_name": "sf", "node_id": "test.my_dbt_project.source_not_null_dbt_jyeo_raw_create.f79610167c"} */
select
count(*) as failures,
count(*) != 0 as should_warn,
count(*) != 0 as should_error
from (
select create
from development_jyeo.dbt_jyeo.raw
where create is null
) dbt_internal_test
22:14:41 Opening a new connection, currently in state closed
22:14:43 Snowflake adapter: Snowflake query id: 01b56876-0905-0194-000d-378339bd9326
22:14:43 Snowflake adapter: Snowflake error: 001003 (42000): SQL compilation error:
syntax error line 12 at position 7 unexpected 'create'.
syntax error line 14 at position 6 unexpected 'create'.
22:14:43 On test.my_dbt_project.source_not_null_dbt_jyeo_raw_create.f79610167c: Close
22:14:44 Database Error in test source_not_null_dbt_jyeo_raw_create (models/sources.yml)
001003 (42000): SQL compilation error:
syntax error line 12 at position 7 unexpected 'create'.
syntax error line 14 at position 6 unexpected 'create'.
compiled Code at target/run/my_dbt_project/models/sources.yml/source_not_null_dbt_jyeo_raw_create.sql
22:14:44 1 of 1 ERROR source_not_null_dbt_jyeo_raw_create ............................... [ERROR in 2.27s] Error as expected. Add version: 2
sources:
- name: dbt_jyeo
tables:
- name: raw
columns:
- name: create
quote: true
data_tests:
- not_null $ dbt --debug test
22:15:46 On test.my_dbt_project.source_not_null_dbt_jyeo_raw__create_.56364b7a58: /* {"app": "dbt", "dbt_version": "1.8.3", "profile_name": "all", "target_name": "sf", "node_id": "test.my_dbt_project.source_not_null_dbt_jyeo_raw__create_.56364b7a58"} */
select
count(*) as failures,
count(*) != 0 as should_warn,
count(*) != 0 as should_error
from (
select "create"
from development_jyeo.dbt_jyeo.raw
where "create" is null
) dbt_internal_test
22:15:46 Opening a new connection, currently in state closed
22:15:47 SQL status: SUCCESS 1 in 2.0 seconds
22:15:47 On test.my_dbt_project.source_not_null_dbt_jyeo_raw__create_.56364b7a58: Close
22:15:48 1 of 1 PASS source_not_null_dbt_jyeo_raw__create_ .............................. [PASS in 2.26s] Works as expected. This is not a unit test though - not yet familiar with how to set that up. |
Interesting when I do this in my project |
Is this a new bug in dbt-snowflake?
Current Behavior
The
quoting
config doesn't quote the database anymore in 1.8 unlike it did pre-1.8.Expected Behavior
The
quoting
configs should quote the database like it did pre-1.8.Steps To Reproduce
quoting.database = true
:Relevant log output
No response
Environment
Additional Context
I don't think schema quoting is working either.
1.8:
dbt-snowflake/dbt/include/snowflake/macros/adapters.sql
Line 127 in cc13888
1.7:
dbt-snowflake/dbt/include/snowflake/macros/adapters.sql
Line 127 in f1fc948
The text was updated successfully, but these errors were encountered: