Skip to main content

Configure and enforce conventions for your dbt project.

Project description

dbt-bouncer logo

dbt-bouncer

Configure and enforce conventions for your dbt project.


How to use

  1. Generate a manifest.json by running dbt parse.
  2. Create a dbt-bouncer.yml config file, details here.
  3. Run dbt-bouncer to validate that your conventions are being maintained. You can use GitHub Actions, Docker, a .pex file or python to run dbt-bouncer.

GitHub Actions

steps:
    ...

    - uses: godatadriven/dbt-bouncer@v0
      with:
        config-file: ./<PATH_TO_CONFIG_FILE>
        send-pr-comment: true # optional, defaults to true

    ...

Docker

Don't use GitHub Actions? You can still use dbt-bouncer via Docker:

docker run --rm \
    --volume "$PWD":/app \
    ghcr.io/godatadriven/dbt-bouncer:vX.X.X \
    --config-file /app/<PATH_TO_CONFIG_FILE>

Pex

You can also run the .pex (Python EXecutable) artifact directly once you have a python executable installed:

wget https://github.com/godatadriven/dbt-bouncer/releases/download/vX.X.X/dbt-bouncer.pex -O dbt-bouncer.pex

dbt-bouncer.pex --config-file $PWD/<PATH_TO_CONFIG_FILE>

Python

Install from pypi.org:

pip install dbt-bouncer

Run:

dbt-bouncer.pex --config-file $PWD/<PATH_TO_CONFIG_FILE>

Config file

dbt-bouncer requires a config file to be provided. This file configures what checks are run. Here is an example config file:

dbt-artifacts-dir: target # [Optional] Directory where the dbt artifacts exists, generally the `target` directory inside a dbt project. Defaults to `./target`.

manifest_checks:
  - name: check_macro_name_matches_file_name
  - name: check_model_names
    include: ^staging
    model_name_pattern: ^stg_

Checks

:bulb: Click on a check name to see more details.

Macros

Metadata

Miscellaneous

Models

Sources

Development

To setup your development environment, fork this repository and run:

poetry shell
poetry install
pre-commit install

Set required environment variables by copying .env.example to .env and updating the values.

All tests can be run via:

make build-artifacts # Rebuilds dbt artifacts used by pytest
make test

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

dbt_bouncer-0.14.3.tar.gz (14.2 kB view hashes)

Uploaded Source

Built Distribution

dbt_bouncer-0.14.3-py3-none-any.whl (18.0 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page