Catalog Checks: Columns#
Note
The below checks require both catalog.json
and manifest.json
to be present.
Classes:
Name | Description |
---|---|
CheckColumnDescriptionPopulated |
Columns must have a populated description. |
CheckColumnHasSpecifiedTest |
Columns that match the specified regexp pattern must have a specified test. |
CheckColumnNameCompliesToColumnType |
Columns with specified data types must comply to the specified regexp naming pattern. |
CheckColumnsAreAllDocumented |
All columns in a model should be included in the model's properties file, i.e. |
CheckColumnsAreDocumentedInPublicModels |
Columns should have a populated description in public models. |
CheckColumnDescriptionPopulated
#
Columns must have a populated description.
Receives at execution time:
Name | Type | Description |
---|---|---|
catalog_node |
CatalogTable
|
The CatalogTable object to check. |
models |
List[DbtBouncerModelBase]
|
List of DbtBouncerModelBase objects parsed from |
Other Parameters (passed via config file):
Name | Type | Description |
---|---|---|
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/catalog/check_columns.py
CheckColumnHasSpecifiedTest
#
Columns that match the specified regexp pattern must have a specified test.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
column_name_pattern
|
str
|
Regex pattern to match the column name. |
required |
test_name
|
str
|
Name of the test to check for. |
required |
Receives at execution time:
Name | Type | Description |
---|---|---|
catalog_node |
CatalogTable
|
The CatalogTable object to check. |
tests |
List[DbtBouncerTestBase]
|
List of DbtBouncerTestBase objects parsed from |
Other Parameters (passed via config file):
Name | Type | Description |
---|---|---|
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):
catalog_checks:
- name: check_column_has_specified_test
column_name_pattern: ^is_.*
test_name: not_null
Source code in src/dbt_bouncer/checks/catalog/check_columns.py
CheckColumnNameCompliesToColumnType
#
Columns with specified data types must comply to the specified regexp naming pattern.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
column_name_pattern
|
str
|
Regex pattern to match the model name. |
required |
types
|
List[str]
|
List of data types to check. |
required |
Receives at execution time:
Name | Type | Description |
---|---|---|
catalog_node |
CatalogTable
|
The CatalogTable object to check. |
Other Parameters (passed via config file):
Name | Type | Description |
---|---|---|
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):
catalog_checks:
# DATE columns must end with "_date"
- name: check_column_name_complies_to_column_type
column_name_pattern: .*_date$
types:
- DATE
catalog_checks:
# BOOLEAN columns must start with "is_"
- name: check_column_name_complies_to_column_type
column_name_pattern: ^is_.*
types:
- BOOLEAN
catalog_checks:
# Columns of all types must consist of lowercase letters and underscores. Note that the specified types depend on the underlying database.
- name: check_column_name_complies_to_column_type
column_name_pattern: ^[a-z_]*$
types:
- BIGINT
- BOOLEAN
- DATE
- DOUBLE
- INTEGER
- VARCHAR
Source code in src/dbt_bouncer/checks/catalog/check_columns.py
CheckColumnsAreAllDocumented
#
All columns in a model should be included in the model's properties file, i.e. .yml
file.
Receives at execution time:
Name | Type | Description |
---|---|---|
catalog_node |
CatalogTable
|
The CatalogTable object to check. |
models |
List[DbtBouncerModel]
|
List of DbtBouncerModel objects parsed from |
Other Parameters (passed via config file):
Name | Type | Description |
---|---|---|
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/catalog/check_columns.py
CheckColumnsAreDocumentedInPublicModels
#
Columns should have a populated description in public models.
Receives at execution time:
Name | Type | Description |
---|---|---|
catalog_node |
CatalogTable
|
The CatalogTable object to check. |
models |
List[DbtBouncerModel]
|
List of DbtBouncerModel objects parsed from |
Other Parameters (passed via config file):
Name | Type | Description |
---|---|---|
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):