dbt-bouncer
raw JSON → 3.0.2 verified Fri May 01 auth: no python
Configure and enforce conventions for your dbt project with automated rules and checks. Current version 3.0.2, compatible with Python >=3.11, <3.15. Released approximately every few months.
pip install dbt-bouncer Common errors
error ModuleNotFoundError: No module named 'dbt_bouncer' ↓
cause Package installed under wrong name (dbt-bouncer) or not installed.
fix
Run: pip install dbt-bouncer (note the hyphen, but import uses underscore)
error dbt_bouncer.exceptions.RuleExecutionError: Rule 'test_rule' failed to execute: 'NoneType' object has no attribute 'get' ↓
cause Manifest file is missing expected keys (e.g., nodes, sources).
fix
Ensure the manifest path is correct and the file is a complete dbt manifest (e.g., target/manifest.json).
Warnings
breaking Version 3.0.0 removed support for Python 3.9 and 3.10. Requires Python >=3.11. ↓
fix Upgrade Python to 3.11 or higher.
deprecated Using a global rule configuration file (e.g., .dbt-bouncer.yml) is deprecated in favor of inline rule definitions. ↓
fix Define rules in your Python code when initializing DbtBouncer.
gotcha Manifest path must point to a valid dbt manifest JSON file. Using an outdated manifest can cause false positives. ↓
fix Run `dbt docs generate` or `dbt run` first to produce an up-to-date manifest.
Imports
- DbtBouncer wrong
from dbtbouncer import DbtBouncercorrectfrom dbt_bouncer import DbtBouncer - RuleBase
from dbt_bouncer.rule_base import RuleBase
Quickstart
from dbt_bouncer import DbtBouncer
# Initialize with default rules
bouncer = DbtBouncer()
# Run checks against a dbt manifest (e.g., target/manifest.json)
results = bouncer.check(manifest_path='target/manifest.json')
print(results)