EqualExperts/dbt-unit-testing

The dbt-unit-testing ref implementation cannot go through dbt-config and dispatch.

adrian-damaschin opened this issue · 2 comments

Hi team,

When adding DBT-UNIT-TESTING implementation our project cannot compile anymore.

We use a combination of 2 projects:

  1. core
  2. client customization

we have some cases when we have a double model implementation with the same name one in core one in client.

For these cases we use dbt config to sort through how these models are picked up:

dispatch:
- macro_namespace: dbt
  search_order:
  - client_test
  - dp_core
  - dbt

and also disable the core models where needed:

models:
  dp_core:
    schema:
      final:
        model_name:
          enabled: false

In these cases the overridden ref function cannot handle dispatch because of the
https://github.com/EqualExperts/dbt-unit-testing/blob/master/macros/overrides.sql#L2
instruction which cannot work through the dbt dispatch config and search for the second model.

Just to clarify, This means that my project compiles properly without unit-test run. but when adding the tag, compilation fails because of deactivated models in dbt_project.yml

This is valid for both ref() implementation and source() macros overriding the builtins