Manifest Checks: Exposures#
Note
The below checks require manifest.json to be present.
Classes:
| Name | Description |
|---|---|
CheckExposureOnModel |
Exposures should depend on a model. |
CheckExposureOnNonPublicModels |
Exposures should be based on public models only. |
CheckExposureOnView |
Exposures should not be based on views. |
CheckExposureOnModel
#
Exposures should depend on a model.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
max_number_of_models
|
Optional[int]
|
The maximum number of models an exposure can depend on, defaults to 100. |
required |
min_number_of_models
|
Optional[int]
|
The minimum number of models an exposure can depend on, defaults to 1. |
required |
Receives at execution time:
| Name | Type | Description |
|---|---|---|
exposure |
DbtBouncerExposureBase
|
The DbtBouncerExposureBase object to check. |
Other Parameters (passed via config file):
| Name | Type | Description |
|---|---|---|
description |
Optional[str]
|
Description of what the check does and why it is implemented. |
exclude |
Optional[str]
|
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 |
Optional[str]
|
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 |
Optional[Literal['error', 'warn']]
|
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
CheckExposureOnNonPublicModels
#
Exposures should be based on public models only.
Receives at execution time:
| Name | Type | Description |
|---|---|---|
exposure |
DbtBouncerExposureBase
|
The DbtBouncerExposureBase object to check. |
models |
List[DbtBouncerModelBase]
|
List of DbtBouncerModelBase objects parsed from |
Other Parameters (passed via config file):
| Name | Type | Description |
|---|---|---|
description |
Optional[str]
|
Description of what the check does and why it is implemented. |
exclude |
Optional[str]
|
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 |
Optional[str]
|
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 |
Optional[Literal['error', 'warn']]
|
Severity level of the check. Default: |
Example(s):
Source code in src/dbt_bouncer/checks/manifest/check_exposures.py
CheckExposureOnView
#
Exposures should not be based on views.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
materializations_to_include
|
Optional[List[str]]
|
List of materializations to include in the check. |
required |
Receives at execution time:
| Name | Type | Description |
|---|---|---|
exposure |
DbtBouncerExposureBase
|
The DbtBouncerExposureBase object to check. |
models |
List[DbtBouncerModelBase]
|
List of DbtBouncerModelBase objects parsed from |
Other Parameters (passed via config file):
| Name | Type | Description |
|---|---|---|
description |
Optional[str]
|
Description of what the check does and why it is implemented. |
exclude |
Optional[str]
|
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 |
Optional[str]
|
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 |
Optional[Literal['error', 'warn']]
|
Severity level of the check. Default: |
Example(s):
manifest_checks:
- name: check_exposure_based_on_view
materializations_to_include:
- ephemeral
- my_custom_materialization
- view