Skip to content

Commit

Permalink
Merge branch 'main' into er/add-redshift-testing
Browse files Browse the repository at this point in the history
  • Loading branch information
dbeatty10 committed Nov 22, 2024
2 parents 36e40e8 + b28ab7d commit 3354649
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

{% set target_schema=api.Relation.create(
database=target.database,
schema="codegen_integration_tests__data_source_schema"
schema=target.schema ~ "__data_source_schema"
) %}


Expand Down
2 changes: 1 addition & 1 deletion integration_tests/models/model_without_import_ctes.sql
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ with my_first_cte as (
my_second_cte as (
select
1 as id
from codegen_integration_tests__data_source_schema.codegen_integration_tests__data_source_table
from {{ target.schema }}__data_source_schema.codegen_integration_tests__data_source_table
union all
select
2 as id
Expand Down
1 change: 1 addition & 0 deletions integration_tests/models/source.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ version: 2

sources:
- name: codegen_integration_tests__data_source_schema
schema: "{{ target.schema ~ '__data_source_schema' }}"
tables:
- name: codegen_integration_tests__data_source_table
columns:
Expand Down
11 changes: 2 additions & 9 deletions integration_tests/tests/test_generate_model_import_ctes.sql
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,7 @@
materialized='table',
) }}{% endraw %}

with codegen_integration_tests__data_source_schema_codegen_integration_tests__data_source_table as (

select * from codegen_integration_tests__data_source_schema.codegen_integration_tests__data_source_table
-- CAUTION: It's best practice to use the ref or source function instead of a direct reference

),

data__a_relation as (
with data__a_relation as (

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

Expand Down Expand Up @@ -108,7 +101,7 @@ my_first_cte as (
my_second_cte as (
select
1 as id
from codegen_integration_tests__data_source_schema_codegen_integration_tests__data_source_table
from {% raw %}{{ target.schema }}{% endraw %}__data_source_schema.codegen_integration_tests__data_source_table
union all
select
2 as id
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,7 @@
materialized='table',
) }}{% endraw %}

with codegen_integration_tests__data_source_schema_codegen_integration_tests__data_source_table as (

select * from codegen_integration_tests__data_source_schema.codegen_integration_tests__data_source_table
-- CAUTION: It's best practice to use the ref or source function instead of a direct reference

)

,data__a_relation as (
with data__a_relation as (

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

Expand Down Expand Up @@ -109,7 +102,7 @@ with codegen_integration_tests__data_source_schema_codegen_integration_tests__da
my_second_cte as (
select
1 as id
from codegen_integration_tests__data_source_schema_codegen_integration_tests__data_source_table
from {% raw %}{{ target.schema }}{% endraw %}__data_source_schema.codegen_integration_tests__data_source_table
union all
select
2 as id
Expand Down

0 comments on commit 3354649

Please sign in to comment.