Manifest Checks: Models#
Note
The below checks require manifest.json
to be present.
Classes:
Name | Description |
---|---|
CheckModelAccess |
Models must have the specified access attribute. Requires dbt 1.7+. |
CheckModelCodeDoesNotContainRegexpPattern |
The raw code for a model must not match the specified regexp pattern. |
CheckModelContractsEnforcedForPublicModel |
Public models must have contracts enforced. |
CheckModelDependsOnMultipleSources |
Models cannot reference more than one source. |
CheckModelDescriptionContainsRegexPattern |
Models must have a description that matches the provided pattern. |
CheckModelDescriptionPopulated |
Models must have a populated description. |
CheckModelDirectories |
Only specified sub-directories are permitted. |
CheckModelDocumentedInSameDirectory |
Models must be documented in the same directory where they are defined (i.e. |
CheckModelGrantPrivilege |
Model can have grant privileges that match the specified pattern. |
CheckModelGrantPrivilegeRequired |
Model must have the specified grant privilege. |
CheckModelHasContractsEnforced |
Model must have contracts enforced. |
CheckModelHasMetaKeys |
The |
CheckModelHasNoUpstreamDependencies |
Identify if models have no upstream dependencies as this likely indicates hard-coded tables references. |
CheckModelHasSemiColon |
Model may not end with a semi-colon ( |
CheckModelHasTags |
Models must have the specified tags. |
CheckModelHasUniqueTest |
Models must have a test for uniqueness of a column. |
CheckModelHasUnitTests |
Models must have more than the specified number of unit tests. |
CheckModelLatestVersionSpecified |
Check that the |
CheckModelMaxChainedViews |
Models cannot have more than the specified number of upstream dependents that are not tables. |
CheckModelMaxFanout |
Models cannot have more than the specified number of downstream models. |
CheckModelMaxNumberOfLines |
Models may not have more than the specified number of lines. |
CheckModelMaxUpstreamDependencies |
Limit the number of upstream dependencies a model has. |
CheckModelNames |
Models must have a name that matches the supplied regex. |
CheckModelNumberOfGrants |
Model can have the specified number of privileges. |
CheckModelPropertyFileLocation |
Model properties files must follow the guidance provided by dbt here. |
CheckModelSchemaName |
Models must have a schema name that matches the supplied regex. |
CheckModelVersionAllowed |
Check that the version of the model matches the supplied regex pattern. |
CheckModelVersionPinnedInRef |
Check that the version of the model is always specified in downstream nodes. |
CheckModelsDocumentationCoverage |
Set the minimum percentage of models that have a populated description. |
CheckModelsTestCoverage |
Set the minimum percentage of models that have at least one test. |
CheckModelAccess
#
Models must have the specified access attribute. Requires dbt 1.7+.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
access
|
Literal['private', 'protected', 'public']
|
The access level to check for. |
required |
Receives at execution time:
Name | Type | Description |
---|---|---|
model |
DbtBouncerModelBase
|
The DbtBouncerModelBase 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 model path. Model paths that match the pattern will not be checked. |
include |
Optional[str]
|
Regex pattern to match the model path. Only model paths that match the pattern will be checked. |
severity |
Optional[Literal['error', 'warn']]
|
Severity level of the check. Default: |
Example(s):
manifest_checks:
# Align with dbt best practices that marts should be `public`, everything else should be `protected`
- name: check_model_access
access: protected
include: ^models/intermediate
- name: check_model_access
access: public
include: ^models/marts
- name: check_model_access
access: protected
include: ^models/staging
Source code in src/dbt_bouncer/checks/manifest/check_models.py
CheckModelCodeDoesNotContainRegexpPattern
#
The raw code for a model must not match the specified regexp pattern.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
regexp_pattern
|
str
|
The regexp pattern that should not be matched by the model code. |
required |
Receives at execution time:
Name | Type | Description |
---|---|---|
model |
DbtBouncerModelBase
|
The DbtBouncerModelBase 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 model path. Model paths that match the pattern will not be checked. |
include |
Optional[str]
|
Regex pattern to match the model path. Only model paths that match the pattern will be checked. |
severity |
Optional[Literal['error', 'warn']]
|
Severity level of the check. Default: |
Example(s):
manifest_checks:
# Prefer `coalesce` over `ifnull`: https://docs.sqlfluff.com/en/stable/rules.html#sqlfluff.rules.sphinx.Rule_CV02
- name: check_model_code_does_not_contain_regexp_pattern
regexp_pattern: .*[i][f][n][u][l][l].*
Source code in src/dbt_bouncer/checks/manifest/check_models.py
CheckModelContractsEnforcedForPublicModel
#
Public models must have contracts enforced.
Receives at execution time:
Name | Type | Description |
---|---|---|
model |
DbtBouncerModelBase
|
The DbtBouncerModelBase 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 model path. Model paths that match the pattern will not be checked. |
include |
Optional[str]
|
Regex pattern to match the model path. Only model 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_models.py
CheckModelDependsOnMultipleSources
#
Models cannot reference more than one source.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
model
|
DbtBouncerModelBase
|
The DbtBouncerModelBase object to check. |
required |
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 model path. Model paths that match the pattern will not be checked. |
include |
Optional[str]
|
Regex pattern to match the model path. Only model 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_models.py
CheckModelDescriptionContainsRegexPattern
#
Models must have a description that matches the provided pattern.
Receives at execution time:
Name | Type | Description |
---|---|---|
model |
DbtBouncerModelBase
|
The DbtBouncerModelBase object to check. |
regexp_pattern |
str
|
The regexp pattern that should match the model description. |
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 model path. Model paths that match the pattern will not be checked. |
include |
Optional[str]
|
Regex pattern to match the model path. Only model 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_model_description_contains_regex_pattern
- regex_pattern: .*pattern_to_match.*
Source code in src/dbt_bouncer/checks/manifest/check_models.py
CheckModelDescriptionPopulated
#
Models must have a populated description.
Receives at execution time:
Name | Type | Description |
---|---|---|
model |
DbtBouncerModelBase
|
The DbtBouncerModelBase 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 model path. Model paths that match the pattern will not be checked. |
include |
Optional[str]
|
Regex pattern to match the model path. Only model 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_models.py
CheckModelDirectories
#
Only specified sub-directories are permitted.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
include
|
str
|
Regex pattern to the directory to check. |
required |
permitted_sub_directories
|
List[str]
|
List of permitted sub-directories. |
required |
Receives at execution time:
Name | Type | Description |
---|---|---|
model |
DbtBouncerModelBase
|
The DbtBouncerModelBase object to check. |
Example(s):
manifest_checks:
- name: check_model_directories
include: models
permitted_sub_directories:
- intermediate
- marts
- staging
# Restrict sub-directories within `./models/staging`
- name: check_model_directories
include: ^models/staging
permitted_sub_directories:
- crm
- payments
Source code in src/dbt_bouncer/checks/manifest/check_models.py
CheckModelDocumentedInSameDirectory
#
Models must be documented in the same directory where they are defined (i.e. .yml
and .sql
files are in the same directory).
Receives at execution time:
Name | Type | Description |
---|---|---|
model |
DbtBouncerModelBase
|
The DbtBouncerModelBase 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 model path. Model paths that match the pattern will not be checked. |
include |
Optional[str]
|
Regex pattern to match the model path. Only model 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_models.py
CheckModelGrantPrivilege
#
Model can have grant privileges that match the specified pattern.
Receives at execution time:
Name | Type | Description |
---|---|---|
model |
DbtBouncerModelBase
|
The DbtBouncerModelBase object to check. |
privilege_pattern |
str
|
Regex pattern to match the privilege. |
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 model path. Model paths that match the pattern will not be checked. |
include |
Optional[str]
|
Regex pattern to match the model path. Only model 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_model_grant_privilege
include: ^models/marts
privilege_pattern: ^select
Source code in src/dbt_bouncer/checks/manifest/check_models.py
CheckModelGrantPrivilegeRequired
#
Model must have the specified grant privilege.
Receives at execution time:
Name | Type | Description |
---|---|---|
model |
DbtBouncerModelBase
|
The DbtBouncerModelBase object to check. |
privilege |
str
|
The privilege that is required. |
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 model path. Model paths that match the pattern will not be checked. |
include |
Optional[str]
|
Regex pattern to match the model path. Only model 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_model_grant_privilege_required
include: ^models/marts
privilege: select
Source code in src/dbt_bouncer/checks/manifest/check_models.py
CheckModelHasContractsEnforced
#
Model must have contracts enforced.
Receives at execution time:
Name | Type | Description |
---|---|---|
model |
DbtBouncerModelBase
|
The DbtBouncerModelBase 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 model path. Model paths that match the pattern will not be checked. |
include |
Optional[str]
|
Regex pattern to match the model path. Only model 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_models.py
CheckModelHasMetaKeys
#
The meta
config for models must have the specified keys.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
keys
|
NestedDict
|
A list (that may contain sub-lists) of required keys. |
required |
model
|
DbtBouncerModelBase
|
The DbtBouncerModelBase object to check. |
required |
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 model path. Model paths that match the pattern will not be checked. |
include |
Optional[str]
|
Regex pattern to match the model path. Only model 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_models.py
CheckModelHasNoUpstreamDependencies
#
Identify if models have no upstream dependencies as this likely indicates hard-coded tables references.
Receives at execution time:
Name | Type | Description |
---|---|---|
model |
DbtBouncerModelBase
|
The DbtBouncerModelBase 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 model path. Model paths that match the pattern will not be checked. |
include |
Optional[str]
|
Regex pattern to match the model path. Only model 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_models.py
CheckModelHasSemiColon
#
Model may not end with a semi-colon (;
).
Receives at execution time:
Name | Type | Description |
---|---|---|
model |
DbtBouncerModelBase
|
The DbtBouncerModelBase 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 model path. Model paths that match the pattern will not be checked. |
include |
Optional[str]
|
Regex pattern to match the model path. Only model 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_models.py
CheckModelHasTags
#
Models must have the specified tags.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
model
|
DbtBouncerModelBase
|
The DbtBouncerModelBase object to check. |
required |
tags
|
List[str]
|
List of tags to check for. |
required |
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 model path. Model paths that match the pattern will not be checked. |
include |
Optional[str]
|
Regex pattern to match the model path. Only model 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_models.py
CheckModelHasUniqueTest
#
Models must have a test for uniqueness of a column.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
accepted_uniqueness_tests
|
Optional[List[str]]
|
List of tests that are accepted as uniqueness tests. |
required |
model
|
DbtBouncerModelBase
|
The DbtBouncerModelBase object to check. |
required |
tests
|
List[DbtBouncerTestBase]
|
List of DbtBouncerTestBase objects parsed from |
required |
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 model path. Model paths that match the pattern will not be checked. |
include |
Optional[str]
|
Regex pattern to match the model path. Only model paths that match the pattern will be checked. |
severity |
Optional[Literal['error', 'warn']]
|
Severity level of the check. Default: |
Example(s):
manifest_checks:
# Example of allowing a custom uniqueness test
- name: check_model_has_unique_test
accepted_uniqueness_tests:
- dbt_expectations.expect_compound_columns_to_be_unique # i.e. tests from packages must include package name
- my_custom_uniqueness_test
- unique
Source code in src/dbt_bouncer/checks/manifest/check_models.py
CheckModelHasUnitTests
#
Models must have more than the specified number of unit tests.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
min_number_of_unit_tests
|
Optional[int]
|
The minimum number of unit tests that a model must have. |
required |
Receives at execution time:
Name | Type | Description |
---|---|---|
manifest_obj |
DbtBouncerManifest
|
The DbtBouncerManifest object parsed from |
model |
DbtBouncerModelBase
|
The DbtBouncerModelBase object to check. |
unit_tests |
List[UnitTests]
|
List of UnitTests 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 model path. Model paths that match the pattern will not be checked. |
include |
Optional[str]
|
Regex pattern to match the model path. Only model paths that match the pattern will be checked. |
severity |
Optional[Literal['error', 'warn']]
|
Severity level of the check. Default: |
Warning
This check is only supported for dbt 1.8.0 and above.
Example(s):
Source code in src/dbt_bouncer/checks/manifest/check_models.py
CheckModelLatestVersionSpecified
#
Check that the latest_version
attribute of the model is set.
Receives at execution time:
Name | Type | Description |
---|---|---|
model |
DbtBouncerModelBase
|
The DbtBouncerModelBase 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 model path. Model paths that match the pattern will not be checked. |
include |
Optional[str]
|
Regex pattern to match the model path. Only model 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_models.py
CheckModelMaxChainedViews
#
Models cannot have more than the specified number of upstream dependents that are not tables.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
materializations_to_include
|
Optional[List[str]]
|
List of materializations to include in the check. |
required |
max_chained_views
|
Optional[int]
|
The maximum number of upstream dependents that are not tables. |
required |
Receives at execution time:
Name | Type | Description |
---|---|---|
model |
DbtBouncerModelBase
|
The DbtBouncerModelBase 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 model path. Model paths that match the pattern will not be checked. |
include |
Optional[str]
|
Regex pattern to match the model path. Only model 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_model_max_chained_views
materializations_to_include:
- ephemeral
- my_custom_materialization
- view
max_chained_views: 5
Source code in src/dbt_bouncer/checks/manifest/check_models.py
745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 |
|
CheckModelMaxFanout
#
Models cannot have more than the specified number of downstream models.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
max_downstream_models
|
Optional[int]
|
The maximum number of permitted downstream models. |
required |
Receives at execution time:
Name | Type | Description |
---|---|---|
model |
DbtBouncerModelBase
|
The DbtBouncerModelBase 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 model path. Model paths that match the pattern will not be checked. |
include |
Optional[str]
|
Regex pattern to match the model path. Only model 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_models.py
CheckModelMaxNumberOfLines
#
Models may not have more than the specified number of lines.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
max_number_of_lines
|
int
|
The maximum number of permitted lines. |
required |
model
|
DbtBouncerModelBase
|
The DbtBouncerModelBase object to check. |
required |
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 model path. Model paths that match the pattern will not be checked. |
include |
Optional[str]
|
Regex pattern to match the model path. Only model 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_models.py
CheckModelMaxUpstreamDependencies
#
Limit the number of upstream dependencies a model has.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
max_upstream_macros
|
Optional[int]
|
The maximum number of permitted upstream macros. |
required |
max_upstream_models
|
Optional[int]
|
The maximum number of permitted upstream models. |
required |
max_upstream_sources
|
Optional[int]
|
The maximum number of permitted upstream sources. |
required |
Receives at execution time:
Name | Type | Description |
---|---|---|
model |
DbtBouncerModelBase
|
The DbtBouncerModelBase 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 model path. Model paths that match the pattern will not be checked. |
include |
Optional[str]
|
Regex pattern to match the model path. Only model 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_models.py
CheckModelNames
#
Models must have a name that matches the supplied regex.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
model_name_pattern
|
str
|
Regexp the model name must match. |
required |
Receives at execution time:
Name | Type | Description |
---|---|---|
model |
DbtBouncerModelBase
|
The DbtBouncerModelBase 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 model path. Model paths that match the pattern will not be checked. |
include |
Optional[str]
|
Regex pattern to match the model path. Only model 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_model_names
include: ^models/intermediate
model_name_pattern: ^int_
- name: check_model_names
include: ^models/staging
model_name_pattern: ^stg_
Source code in src/dbt_bouncer/checks/manifest/check_models.py
CheckModelNumberOfGrants
#
Model can have the specified number of privileges.
Receives at execution time:
Name | Type | Description |
---|---|---|
max_number_of_privileges |
Optional(int)
|
Maximum number of privileges, inclusive. |
min_number_of_privileges |
Optional(int)
|
Minimum number of privileges, inclusive. |
model |
DbtBouncerModelBase
|
The DbtBouncerModelBase 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 model path. Model paths that match the pattern will not be checked. |
include |
Optional[str]
|
Regex pattern to match the model path. Only model 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_model_number_of_grants
include: ^models/marts
max_number_of_privileges: 1 # Optional
min_number_of_privileges: 0 # Optional
Source code in src/dbt_bouncer/checks/manifest/check_models.py
CheckModelPropertyFileLocation
#
Model properties files must follow the guidance provided by dbt here.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
model
|
DbtBouncerModelBase
|
The DbtBouncerModelBase object to check. |
required |
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 model path. Model paths that match the pattern will not be checked. |
include |
Optional[str]
|
Regex pattern to match the model path. Only model 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_models.py
CheckModelSchemaName
#
Models must have a schema name that matches the supplied regex.
Note that most setups will use schema names in development that are prefixed, for example: * dbt_jdoe_stg_payments * mary_stg_payments
Please account for this if you wish to run dbt-bouncer
against locally generated manifests.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
schema_name_pattern
|
str
|
Regexp the schema name must match. |
required |
Receives at execution time:
Name | Type | Description |
---|---|---|
model |
DbtBouncerModelBase
|
The DbtBouncerModelBase 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 model path. Model paths that match the pattern will not be checked. |
include |
Optional[str]
|
Regex pattern to match the model path. Only model 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_model_schema_name
include: ^models/intermediate
schema_name_pattern: .*intermediate # Accounting for schemas like `dbt_jdoe_intermediate`.
- name: check_model_schema_name
include: ^models/staging
schema_name_pattern: .*stg_.*
Source code in src/dbt_bouncer/checks/manifest/check_models.py
CheckModelVersionAllowed
#
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 |
DbtBouncerModelBase
|
The DbtBouncerModelBase 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 model path. Model paths that match the pattern will not be checked. |
include |
Optional[str]
|
Regex pattern to match the model path. Only model 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_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/check_models.py
CheckModelVersionPinnedInRef
#
Check that the version of the model is always specified in downstream nodes.
Receives at execution time:
Name | Type | Description |
---|---|---|
manifest_obj |
DbtBouncerManifest
|
The DbtBouncerManifest object parsed from |
model |
DbtBouncerModelBase
|
The DbtBouncerModelBase 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 model path. Model paths that match the pattern will not be checked. |
include |
Optional[str]
|
Regex pattern to match the model path. Only model 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_models.py
CheckModelsDocumentationCoverage
#
Set the minimum percentage of models that have a populated description.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
min_model_documentation_coverage_pct
|
float
|
The minimum percentage of models that must have a populated description. |
required |
Receives at execution time:
Name | Type | Description |
---|---|---|
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. |
severity |
Optional[Literal['error', 'warn']]
|
Severity level of the check. Default: |
Example(s):
manifest_checks:
- name: check_model_documentation_coverage
min_model_documentation_coverage_pct: 90
Source code in src/dbt_bouncer/checks/manifest/check_models.py
1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 |
|
CheckModelsTestCoverage
#
Set the minimum percentage of models that have at least one test.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
min_model_test_coverage_pct
|
float
|
The minimum percentage of models that must have at least one test. |
required |
models
|
List[DbtBouncerModelBase]
|
List of DbtBouncerModelBase objects parsed from |
required |
tests
|
List[DbtBouncerTestBase]
|
List of DbtBouncerTestBase objects parsed from |
required |
Other Parameters (passed via config file):
Name | Type | Description |
---|---|---|
description |
Optional[str]
|
Description of what the check does and why it is implemented. |
severity |
Optional[Literal['error', 'warn']]
|
Severity level of the check. Default: |
Example(s):