In dbt_project.yml, I have: ```models: elementar...
# community-support
a
In dbt_project.yml, I have:
Copy code
models:
  elementary:
    +schema: DBT_ELEMENTARY
    +enabled: "{{ target.name == 'prod' }}"
I implement
generate_schema_name
such that DBT's default <target schema>_<schema> is not used but rather <schema> is used in prod and ignored in non-prod. However, in prod, my
edr run-operation upload-source-freshness
job is trying to create stuff in TRANSFORMED_elementary which is super weird. it looks like 2 things are happening: • It's ignoring the schema set above • It's ignoring the override in generate_schema_name that works elsewhere in my project (TRANSFORMED is the value set in profiles.yml's target schema - but it's irrelevant as the macro should be customising behaviour)
Also, when I search custom schema in the docs, your AI assistant generates incorrect and contradictory advice:
schema_name
- no such config field
z
was this ever solved? I'm running into the same issue
a
@Zach Plowman unfortunately not, it's basically not supported and the docs aren't clear and the issue has gone quiet... https://github.com/elementary-data/elementary/issues/1462
šŸ‘€ 1
@Idan Shavit suggests a workaround in the issue which unblocked us - but it's not the semantically correct solution IMO
z
that is unfortunate! Thanks for letting me know
a
so you need to set in profiles.yml. I ended up asked the tool that we use for running our production jobs (paradime - alternative to dbt cloud) to create a special environment variable for this in the behind-the-scenes profile used for the prod job
Luckily, they did.
z
ok this is really helpful. Thank you!
OK so I created another target in my profiles.yml that points to the elementary schema. That allowed me to
dbt run --select elementary --target=elementary
the tables within the elementary schema. Now I've run
dbt tests
and I'm not seeing results in
elementary_test_results
. Is there additional configuration needed?
a
@Zach Plowman don't confuse the dbt commands with the edr commands. Run dbt commands as you do normally with normal target. When you run edr commands, make sure you pass the target parameter (I can't remember exact cli option name - perhaps --target but check docs)
šŸ‘ 1
Presumably you are using either send-report or report
z
we have github actions running our dbt refreshes and testing. those actions also utilize a custom schema name
so the run results are going to the wrong schema
a
That's got nothing to do with elementary then