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

Add config to disable metrics/exposures #5815

Merged
merged 11 commits into from
Sep 14, 2022
Merged

Conversation

emmyoop
Copy link
Member

@emmyoop emmyoop commented Sep 12, 2022

resolves #5422

Description

Support disabling metrics and exposures via config.

Checklist

core/dbt/parser/schemas.py Outdated Show resolved Hide resolved
@cla-bot cla-bot bot added the cla:yes label Sep 12, 2022
@emmyoop emmyoop requested a review from gshank September 12, 2022 16:29
Copy link
Contributor

@gshank gshank left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This config stuff really does get complicated. This looks pretty good to me, with the exception that I think we should change what's returned from 'parse' for metrics and exposures as discussed in that comment.

core/dbt/contracts/graph/manifest.py Show resolved Hide resolved
core/dbt/parser/schemas.py Outdated Show resolved Hide resolved
@github-actions
Copy link
Contributor

Thank you for your pull request! We could not find a changelog entry for this change. For details on how to document a change, see the contributing guide.

@emmyoop emmyoop marked this pull request as ready for review September 13, 2022 16:20
@emmyoop emmyoop requested a review from a team September 13, 2022 16:20
@emmyoop emmyoop requested review from a team as code owners September 13, 2022 16:20
@emmyoop emmyoop requested review from stu-k, gshank and callum-mcdata and removed request for a team September 13, 2022 16:20
Copy link
Contributor

@gshank gshank left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

@callum-mcdata
Copy link
Contributor

Just tested this on my local and can confirm that it works as expected with metrics. Adding the same metric to two different folders resulted in a compilation error. When adding the below code, the definition from one of the folder paths was disabled and thus didn't get picked up.

metrics:
  dbt_metrics_integration_tests:
    testing_disabling__overridden:
      +enabled: false
    testing_disabling:
      +enabled: true

@emmyoop emmyoop merged commit 6c4577f into main Sep 14, 2022
@emmyoop emmyoop deleted the er/ct-788-disable-metrics branch September 14, 2022 19:35
josephberni pushed a commit to Gousto/dbt-core that referenced this pull request Sep 16, 2022
* first pass adding disabled functionality to metrics and exposures

* first pass at getting metrics disabled

* add unsaved file

* fix up comments

* Delete tmp.csv

* fix test

* add exposure logic, fix merge from main

* change when nodes are added to manifest, finish tests

* add changelog

* removed unused code

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

Successfully merging this pull request may close these issues.

[CT-788] Support disabling metrics + exposures
3 participants