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

Governance model exceptions do not work like other exceptions #396

Closed
1 of 6 tasks
c-kennedy opened this issue Nov 21, 2023 · 1 comment · Fixed by #403
Closed
1 of 6 tasks

Governance model exceptions do not work like other exceptions #396

c-kennedy opened this issue Nov 21, 2023 · 1 comment · Fixed by #403
Assignees
Labels
bug Something isn't working

Comments

@c-kennedy
Copy link

Describe the bug

Exceptions to models in the governance section defined in the dbt_project_evaluator_exceptions.csv file are not respected.

Steps to reproduce

  1. In a new project with dbt_project_evaluator v0.8.0, create models/models_config.yml with:
models:
  - name: model_1
    access: public
 
  - name: model_2
    access: protected
  1. Create model_1.sql and model_2.sql, both with:
select 1 as column_1
  1. Create exposures.yml:
exposures:
  - name: exposure_1
    label: Exposure
    type: application
    owner:
      name: me
      email: [email protected]
    depends_on:
      - ref('model_1')
      - ref('model_2')
  1. Create seeds/dbt_project_evaluator_exceptions.csv as:
fct_name,column_name,id_to_exclude,comment
fct_root_models,child,model_%,Comment
fct_exposures_dependent_on_private_models,parent_resource_name,model_%,Comment
fct_undocumented_public_models,parent_resource_name,model_1,Comment
fct_public_models_without_contract,parent_resource,model_1,Comment
  1. Run dbt seed
  2. Run dbt build --select package:dbt_project_evaluator

Expected results

The following tables should be empty as a result of the exceptions configured:

  • fct_exposures_dependent_on_private_models
  • fct_undocumented_public_models
  • fct_public_models_without_contract
  • fct_root_models

Actual results

Only fct_root_models is empty (as a control). The other tables contain results for model_1 and model_2 as if they were not in the exceptions file (exposure_1 depends on the protected model_2; model_1 is public but undocumented; model_1 is public but has no contract).

System information

The contents of your packages.yml file:

packages:
  - package: dbt-labs/dbt_utils
    version: ['>=1.1.0']
  - package: dbt-labs/dbt_project_evaluator
    version: 0.8.0

Which database are you using dbt with?

  • postgres
  • redshift
  • bigquery
  • snowflake
  • trino/starburst
  • other (specify: ____________)

The output of dbt --version:

Core:
- installed: 1.6.4

Plugins:
- snowflake: 1.6.4

Additional context

Are you interested in contributing the fix?

I think this is as simple as changing the last line of the models in question from {{ filter_exceptions(this) }} to {{ filter_exceptions(model.name) }}, but I'm not confident enough in my understanding of dbt to say that this wouldn't break something else.

@c-kennedy c-kennedy added the bug Something isn't working label Nov 21, 2023
@b-per
Copy link
Collaborator

b-per commented Dec 4, 2023

Hi! I think you are right! Would you want to submit a PR for it or would you like us to do it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants