Yunus Emre Gündüz
03/13/2025, 12:31 PMdbt run -s elementary somehow resulted in creating elementary-related tables in the actual schema rather than a new schema suffixed by _elementary . I am using Snowflake and elementary version 0.16.1. I am sharing my configurations:
profiles.yml:
deployment:
outputs:
staging:
account: ...
authenticator: externalbrowser
client_session_keep_alive: false
database: STAGING
role: ...
schema: JAFFLE_SHOP_STAGE
threads: 8
type: snowflake
user: ...
warehouse: ...
target: staging
elementary:
outputs:
default:
account: ...
authenticator: externalbrowser
client_session_keep_alive: false
database: STAGING
role: ...
schema: JAFFLE_SHOP_STAGE_ELEMENTARY
threads: 8
type: snowflake
user: ...
warehouse: ...
dbt_project.yml:
analysis-paths:
- analyses
clean-targets:
- target
- dbt_packages
# config-version: 2
flags:
require_explicit_package_overrides_for_builtin_materializations: false
source_freshness_run_project_hooks: true
macro-paths:
- macros
model-paths:
- models
models:
+post-hook:
- '{{ custom_post_hook.hook(this) }}'
elementary:
+schema: elementary
jaffle_shop:
marts:
+materialized: table
staging:
+materialized: view
sql_header: ALTER SESSION SET QUERY_TAG = 'jaffle_shop_3.0.0';
name: jaffle_shop
on-run-end:
- '{{ my_custom_hook.hook2() }}'
profile: deployment
require-dbt-version: '>=1.5.0'
seed-paths:
- seeds
seeds:
jaffle_shop:
+schema: jaffle_shop_raw
snapshot-paths:
- snapshots
target-path: target
test-paths:
- data-tests
vars:
dbt_date:time_zone: UTC
version: 3.0.0Yunus Emre Gündüz
03/13/2025, 12:47 PMjaffle-shop handling schema naming, that is causing the problem in my case.Yunus Emre Gündüz
03/13/2025, 12:48 PMjaffle-shop for testing the orchestrator and it requires more testing and caused more problem than the orchestrator itself.Noya Offer
03/13/2025, 12:58 PMjaffle-shop now or is it still causing issues?Yunus Emre Gündüz
03/13/2025, 2:36 PMTal Nidam
03/17/2025, 11:37 AMTal Nidam
03/17/2025, 11:38 AMYunus Emre Gündüz
03/17/2025, 11:40 AMjaffle-shop project itself. The project itself customizes generate_schema_name.sql macro. Here, it only adds _elementary suffix for production models. I added other targets and it resolved.Tal Nidam
03/17/2025, 11:44 AM{% macro generate_schema_name(custom_schema_name, node) -%}
{%- set default_schema = target.schema -%}
{{ log(target.schema) }}
{% set config_meta = node.config.get("meta") %}
{% if target.name in ["prod","production", "staging", "test"] %}
{% if config_meta and config_meta is mapping %}
{% set schema_name = config_meta.get("schema_name") %}
{% if schema_name and schema_name is string %}
{{ return("{}_{}".format(default_schema, schema_name)) }}
{% endif %}
{%- elif custom_schema_name is none -%} {{ default_schema }}
{%- else -%} {{ custom_schema_name | trim }}
{%- endif -%}
{%- else -%}
{% if config_meta and config_meta is mapping %}
{% set schema_name = config_meta.get("schema_name") %}
{% if schema_name and schema_name is string %}
{{ return("{}_{}".format(default_schema, schema_name)) }}
{% endif %}
{%- else -%} {{ default_schema | trim }}
{%- endif -%}
{%- endif -%}
{%- endmacro %}
Can you try helpo me?