Skip to content

Commit

Permalink
Added integration test to check for commas on sql without import ctes
Browse files Browse the repository at this point in the history
  • Loading branch information
graciegoheen committed Sep 28, 2022
1 parent 58ad058 commit ca67cea
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
3 changes: 2 additions & 1 deletion integration_tests/models/model_without_any_ctes.sql
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
select *, 2 as col2
from {{ ref('model_without_import_ctes') }}
from {{ ref('model_without_import_ctes') }} as m
left join (select 2 as col_a from {{ ref('data__a_relation') }}) as a on a.col_a = m.id
where id = 1
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,19 @@
%}

{% set expected_model_with_import_ctes %}
with model_without_import_ctes as (
with data__a_relation as (

select * from {% raw %}{{ ref('data__a_relation') }}{% endraw %}

),
model_without_import_ctes as (

select * from {% raw %}{{ ref('model_without_import_ctes') }}{% endraw %}

)
select *, 2 as col2
from model_without_import_ctes
from model_without_import_ctes as m
left join (select 2 as col_a from data__a_relation) as a on a.col_a = m.id
where id = 1
{% endset %}

Expand Down

0 comments on commit ca67cea

Please sign in to comment.