Naza
05/12/2025, 2:23 PMedr report.
I have a profiles.yml like:
dbtpoc:
outputs:
dev:
dbname: pipelinedb
host: localhost
pass: ...
port: ...
schema: dbt_tests
threads: 4
type: postgres
user: ...
target: dev
elementary:
outputs:
default:
type: postgres
host: localhost
user: ...
password: ...
port: ...
dbname: pipelinedb
schema: dbt_tests_elementary
threads: 4
The only configurations in my dbt_project.yml are:
models:
elementary:
+schema: elementary
flags:
require_explicit_package_overrides_for_builtin_materializations: false
source_freshness_run_project_hooks: True
Then, if I do dbt run followed by edr report , I see a nice report with my models built. However, if I follow that up with dbt test and run edr report again, I get a "No test results" report, also without my models. If I click on "Model performance" on the right menu, I also see an infinite spinning wheel as it tries to fetch models, but nothing is shown.
I have checked that
1. pipelinedb.dbt_tests_elementary.elementary_test_results has content
2. There are no errors in edr_target/edr.log
3. The command dbt run-operation elementary.log_macro_results --args '{"macro_name": "elementary_cli.get_tests"}' --project-dir [folder in the logs] returns valid contentkapa.ai
05/12/2025, 2:23 PMkapa.ai
05/12/2025, 2:24 PMNaza
05/12/2025, 3:45 PMkapa.ai
05/12/2025, 3:45 PMkapa.ai
05/12/2025, 3:46 PM+schema: dbt_tests_elementary in your dbt_project.yml, and your dbt project's default schema (from your profile) is already dbt_tests, then dbt's default behavior is to concatenate the target schema and the custom schema, resulting in a schema like dbt_tests_dbt_tests_elementary. This is because dbt's default generate_schema_name macro combines the target schema with the custom schema you specify. So, unless you override this macro, you'll get the double prefix. How to avoid this: If you want the schema to be exactly dbt_tests_elementary (and not dbt_tests_dbt_tests_elementary), you need to override the generate_schema_name macro in your project. The Elementary documentation and community discussions confirm this is the standard approach for custom schema naming in dbt and Elementary: > In short, the default dbt generate_schema_name macro concatenate[s] the value provided in schema configuration key to the target schema, as in: target_schema_custom_schema. > > If you want a different behaviour, like configuring a full name for the Elementary schema, you can override the default generate_schema_name macro with your logic. > [Can I change the Elementary schema?](https://docs.elementary-data.com/oss/general/faq) The documentation provides an example macro you can use to control the schema name more precisely: jinja {% macro generate_schema_name(custom_schema_name, node) -%} {%- set default_schema = target.schema -%} {% set config_meta = node.config.get('meta') %} {% 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(schema_name) }} {% endif %} {%- elif custom_schema_name is none -%} {{ default_schema }} {%- else -%} {{ default_schema }}_{{ custom_schema_name | trim }} {%- endif -%} {%- endmacro %} Or, you can adjust it to return only the custom schema name for Elementary models, as shown in several Slack threads: jinja {% macro generate_schema_name(custom_schema_name, node) -%} {% if node.package_name == 'elementary' and custom_schema_name %} {{ custom_schema_name | trim }} {% else %} {{ target.schema }}_{{ custom_schema_name | trim }} {% endif %} {%- endmacro %} This way, Elementary models will be created in the schema you specify, without the double prefix. For more details, see the FAQ and Slack discussions: [Can I change the Elementary schema?](https://docs.elementary-data.com/oss/general/faq) [Slack thread on custom schema logic](https://slack.com/archives/C02CTC89LAX/p1712851926036669)