Skip to content

Commit 1fc1952

Browse files
Fix get_elementary_database_and_schema to use actual elementary schema
Co-Authored-By: Itamar Hartstein <haritamar@gmail.com>
1 parent 09ed6df commit 1fc1952

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

elementary/monitor/dbt_project/macros/get_elementary_database_and_schema.sql

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
{% macro get_elementary_database_and_schema() %}
2-
{% set database, schema = elementary.target_database(), target.schema %}
2+
{# Use ref() to get the actual schema where elementary tables are created,
3+
accounting for any custom schema configuration in the user's dbt_project.yml #}
4+
{% set elementary_relation = ref('elementary', 'dbt_models') %}
5+
{% set database = elementary_relation.database %}
6+
{% set schema = elementary_relation.schema %}
37
{% if database %}
48
{% do return(database ~ '.' ~ schema) %}
59
{% else %}

0 commit comments

Comments
 (0)