Please can someone from the team take a look at <h...
# community-support
a
Please can someone from the team take a look at https://github.com/elementary-data/elementary/issues/1462? I'm not sure if I have this wrong or if this is genuine bug blocking production deployments whenever using custom schema (and edr send-report)
i
Hey @Adam Cunnington, the dbt macro that you override is only part of your dbt project. When running edr commands you are running a python package that uses an internal dbt project to access the artifacts elementary dbt package is uploading to the schema you define at your dbt project. The internal dbt project that edr is using is not aware of your dbt macro that set the schema. My suggestion is to have 2 targets for the elementary profile you create: 1. Points to the dev schema (TRANSFORMED_elementary) 2. Points to prod schema (DBT_ELEMENTARY) Then when you run edr on prod pass the relevant target that points to the right schema 🙂
a
Thanks for the response. This is a hole in the thinking and it absolutely needs calling out in the docs!
✅ 1
There are plenty of places where the docs even reference the custom schema topic - but effectively, it's an unsupported pattern
Unfortunately, I'm not able to control the targets here as they're dynamically created by the 3rd party that i use for my production jobs; paradime. I will have to speak with them.
@Idan Shavit out of interest, do the edr commands use anything within dbt_project.yml either? or it's purely profiles.yml as the former is only within our project right?
i
Hey @Adam Cunnington, I am not sure I understood correctly the question but I will try to answer. The edr commands use an internal dbt project in order to access the artifacts that were uploaded to your DWH with elementary dbt package that you install in your dbt project. The internal project contains several models and macros that edr runs. The internal project has no connection to your dbt project and is not aware of it, so edr internal dbt project can't access any macro / var / model you define in your dbt project.
a
Ok, yea, it makes sense - but do you agree with me that the docs need to be a lot clearer on this point? It's a bit confusing because the custom schema pattern is referenced in the docs but essentially, that pattern will only work for dbt commands. When it comes to edr commands, this information is opaque and the user needs to ensure their profiles.yml exactly matches the output of any schema logic in their dbt project for the end to end flow to work