Manifest Checks: Exposures#
Note
The below checks require manifest.json to be present.
Functions:
| Name | Description |
|---|---|
check_exposure_based_on_model |
Exposures should depend on a model. |
check_exposure_based_on_view |
Exposures should not be based on views. |
check_exposure_based_on_non_public_models |
Exposures should be based on public models only. |
check_exposure_based_on_model
#
Exposures should depend on a model.
Rationale
Exposures document downstream consumers of dbt models — dashboards, ML models, and APIs. If an exposure references no models (or too many), it signals that the lineage metadata is incomplete or incorrect. Enforcing a model count range ensures each exposure is meaningfully connected to the data layer it represents, keeping documentation trustworthy.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
maximum_number_of_models
|
int | None
|
The maximum number of models an exposure can depend on, defaults to 100. |
100
|
minimum_number_of_models
|
int | None
|
The minimum number of models an exposure can depend on, defaults to 1. |
1
|
Receives at execution time:
| Name | Type | Description |
|---|---|---|
exposure |
ExposureNode
|
The ExposureNode object to check. |
Other Parameters (passed via config file):
| Name | Type | Description |
|---|---|---|
description |
str | None
|
Description of what the check does and why it is implemented. |
exclude |
str | None
|
Regex pattern to match the exposure path (i.e the .yml file where the exposure is configured). Exposure paths that match the pattern will not be checked. |
include |
str | None
|
Regex pattern to match the exposure path (i.e the .yml file where the exposure is configured). Only exposure paths that match the pattern will be checked. |
severity |
Literal[error, warn] | None
|
Severity level of the check. Default: |
Example(s):
manifest_checks:
- name: check_exposure_based_on_model
maximum_number_of_models: 3
minimum_number_of_models: 1
Source code in src/dbt_bouncer/checks/manifest/check_exposures.py
check_exposure_based_on_view
#
Exposures should not be based on views.
Rationale
Views and ephemeral models recompute their SQL every time they are queried. When a BI tool or downstream application queries an exposure built on a view, it triggers a full recomputation on every refresh, which can be slow and expensive at scale. Exposures should sit on top of materialised tables to ensure consistent, performant query times for end users.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
materializations_to_include
|
list[str] | None
|
List of materializations to include in the check. |
['ephemeral', 'view']
|
Receives at execution time:
| Name | Type | Description |
|---|---|---|
exposure |
ExposureNode
|
The ExposureNode object to check. |
models |
list[ModelNode]
|
List of ModelNode objects parsed from |
Other Parameters (passed via config file):
| Name | Type | Description |
|---|---|---|
description |
str | None
|
Description of what the check does and why it is implemented. |
exclude |
str | None
|
Regex pattern to match the exposure path (i.e the .yml file where the exposure is configured). Exposure paths that match the pattern will not be checked. |
include |
str | None
|
Regex pattern to match the exposure path (i.e the .yml file where the exposure is configured). Only exposure paths that match the pattern will be checked. |
severity |
Literal[error, warn] | None
|
Severity level of the check. Default: |
Example(s):
manifest_checks:
- name: check_exposure_based_on_view
materializations_to_include:
- ephemeral
- my_custom_materialization
- view
Source code in src/dbt_bouncer/checks/manifest/check_exposures.py
check_exposure_based_on_non_public_models
#
Exposures should be based on public models only.
Rationale
Public access in dbt signals that a model is stable, well-tested, and safe to depend on externally. Exposures that reference protected or private models create implicit dependencies on implementation details that may change without warning, increasing the risk of broken dashboards or pipelines when internal models are refactored.
Receives at execution time:
| Name | Type | Description |
|---|---|---|
exposure |
ExposureNode
|
The ExposureNode object to check. |
Other Parameters (passed via config file):
| Name | Type | Description |
|---|---|---|
description |
str | None
|
Description of what the check does and why it is implemented. |
exclude |
str | None
|
Regex pattern to match the exposure path (i.e the .yml file where the exposure is configured). Exposure paths that match the pattern will not be checked. |
include |
str | None
|
Regex pattern to match the exposure path (i.e the .yml file where the exposure is configured). Only exposure paths that match the pattern will be checked. |
severity |
Literal[error, warn] | None
|
Severity level of the check. Default: |
Example(s):