Versioning#
Note
The below checks require manifest.json to be present.
Checks related to model versioning.
Functions:
| Name | Description |
|---|---|
check_model_latest_version_specified |
Check that the |
check_model_version_allowed |
Check that the version of the model matches the supplied regex pattern. |
check_model_version_pinned_in_ref |
Check that the version of the model is always specified in downstream nodes. |
check_model_latest_version_specified
#
Check that the latest_version attribute of the model is set.
Receives at execution time:
| Name | Type | Description |
|---|---|---|
model |
ModelNode
|
The ModelNode 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 model path. Model paths that match the pattern will not be checked. |
include |
str | None
|
Regex pattern to match the model path. Only model paths that match the pattern will be checked. |
materialization |
Literal[ephemeral, incremental, table, view] | None
|
Limit check to models with the specified materialization. |
severity |
Literal[error, warn] | None
|
Severity level of the check. Default: |
Example(s):
Source code in src/dbt_bouncer/checks/manifest/models/versioning.py
check_model_version_allowed
#
Check that the version of the model matches the supplied regex pattern.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
version_pattern
|
str
|
Regexp the version must match. |
required |
Receives at execution time:
| Name | Type | Description |
|---|---|---|
model |
ModelNode
|
The ModelNode 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 model path. Model paths that match the pattern will not be checked. |
include |
str | None
|
Regex pattern to match the model path. Only model paths that match the pattern will be checked. |
materialization |
Literal[ephemeral, incremental, table, view] | None
|
Limit check to models with the specified materialization. |
severity |
Literal[error, warn] | None
|
Severity level of the check. Default: |
Example(s):
manifest_checks:
- name: check_model_version_allowed
include: ^models/marts
version_pattern: >- # Versions must be numeric
[0-9]\d*
- name: check_model_version_allowed
include: ^models/marts
version_pattern: ^(stable|latest)$ # Version can be "stable" or "latest", nothing else is permitted
Source code in src/dbt_bouncer/checks/manifest/models/versioning.py
check_model_version_pinned_in_ref
#
Check that the version of the model is always specified in downstream nodes.
Receives at execution time:
| Name | Type | Description |
|---|---|---|
manifest_obj |
ManifestObject
|
The ManifestObject object parsed from |
model |
ModelNode
|
The ModelNode 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 model path. Model paths that match the pattern will not be checked. |
include |
str | None
|
Regex pattern to match the model path. Only model paths that match the pattern will be checked. |
materialization |
Literal[ephemeral, incremental, table, view] | None
|
Limit check to models with the specified materialization. |
severity |
Literal[error, warn] | None
|
Severity level of the check. Default: |
Example(s):