Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
adrian-damaschin opened this issue Sep 4, 2023 · 2 comments

Comments

@adrian-damaschin
Copy link

adrian-damaschin commented Sep 4, 2023

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.

@adrian-damaschin adrian-damaschin changed the title Getting issues with reconcile ref names form dbt-core with generated ref names from dbt-unit-testing The dbt-unit-testing ref implementation cannot go through dbt-config and dispatch. Sep 6, 2023
@adrian-damaschin
Copy link
Author

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

@adrian-damaschin
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant