dbt-labs / dbt-labs/dbt

[Feature] Disable `on-run-start` and `on-run-end` hooks from installed packages

Open
#10,592 4 comments 9 reactions 0 assignees View on GitHub
engine:v1 Refinement status:triage type:feature
Dominant language
Rust
Stars
13.8k
Forks
2.6k
Avg merge
21h 31m
Merged PRs (30d)
56

Description

### Is this your first time submitting a feature request?

- [X] I have read the [expectations for open source contributors](https://docs.getdbt.com/docs/contributing/oss-expectations)
- [X] I have searched the existing issues, and I could not find an existing issue for this feature
- [X] I am requesting a straightforward extension of existing dbt functionality, rather than a Big Idea better suited to a discussion

### Describe the feature

Hi all, please correct me if I'm wrong, but I believe it's currently not possible to disable `on-run-start` and `on-run-end` hooks defined in packages installed as dependencies. E.g. `elementary` defines such hooks and they have implemented custom variables to disable them:
https://docs.elementary-data.com/oss/general/faq#can-i-disable-the-on-run-end-hooks-or-results-uploading
but it should be possible to achieve without special logic in the upstream package.

Ofc we can always disable the whole package with `+enabled: false`, but it's not the real solution.

To reproduce:

1. - create `package_a`
- in `pyproject.toml` define `on-run-end: "{{ print('foo') }}"`


2. - create `package_b`
- install `package_a` as dependency
- in `pyproject.toml` define `on-run-end: "{{ print('bar') }}"`
- run e.g. `dbt compile`
- notice both `foo` and `bar` are printed in logs

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.