Skip to content

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

@jaklan

Description

@jaklan

Is this your first time submitting a feature request?

  • I have read the expectations for open source contributors
  • I have searched the existing issues, and I could not find an existing issue for this feature
  • 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:

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

    • 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions