Skip to content

Commit

Permalink
Use a dynamic schema name based off the target schema rather than a h…
Browse files Browse the repository at this point in the history
…ardcoded one
  • Loading branch information
dbeatty10 committed Nov 22, 2024
1 parent c0ac2bc commit 14413f1
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 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

0 comments on commit 14413f1

Please sign in to comment.