Skip to content

Rule codes#

Every built-in check has a unique rule code: a two-letter prefix identifying the group of resources it applies to, followed by a three-digit number. Codes are stable — once published, a code always refers to the same check.

Referencing a check by its code#

Anywhere a check is named you may use its code instead. These two config entries are equivalent:

manifest_checks:
  - name: check_model_description_populated
  - code: MO021

Codes are also accepted in the skip_checks meta key on a dbt resource:

models:
  - name: my_model
    meta:
      skip_checks:
        - MO021

To browse codes from the command line, use dbt-bouncer list, optionally filtered with --group:

dbt-bouncer list --group manifest_checks

Prefixes#

Prefix Group Config category Checks
CA Catalog catalog_checks 11
EX Exposures manifest_checks 6
LI Lineage manifest_checks 3
MA Macros manifest_checks 10
ME Metadata manifest_checks 1
MO Models manifest_checks 58
RR Run results run_results_checks 2
SE Seeds manifest_checks 6
SM Semantic models manifest_checks 1
SN Snapshots manifest_checks 6
SO Sources manifest_checks 17
TE Tests manifest_checks 3
UT Unit tests manifest_checks 3

Catalog (CA)#

Code Check Description
CA001 check_seed_columns_are_all_documented All columns in a seed CSV file should be included in the seed's properties file, i.e. .yml file.
CA002 check_seed_max_bytes Each seed must not exceed the given size in bytes.
CA003 check_seed_max_row_count Each seed must not contain more than the given number of rows.
CA004 check_source_columns_are_all_documented All columns in a source should be included in the source's properties file, i.e. .yml file.
CA005 check_column_description_populated Columns must have a populated description.
CA006 check_columns_are_all_documented All columns in a model should be included in the model's properties file, i.e. .yml file.
CA007 check_columns_are_documented_in_public_models Columns should have a populated description in public models.
CA008 check_column_name_complies_to_column_type Columns with the specified regexp naming pattern must have data types that comply to the specified regexp pattern or list of data types.
CA009 check_column_names Columns must have a name that matches the supplied regex.
CA010 check_column_type_complies_to_column_name Columns with the specified data type must have names that comply to the specified regexp pattern.
CA011 check_column_has_specified_test Columns that match the specified regexp pattern must have a specified test.

Exposures (EX)#

Code Check Description
EX001 check_exposure_based_on_model Exposures should depend on a model.
EX002 check_exposure_based_on_non_public_models Exposures should be based on public models only.
EX003 check_exposure_based_on_view Exposures should not be based on views.
EX004 check_exposure_description_populated Exposures must have a populated description.
EX005 check_exposure_has_meta_keys The meta config for exposures must have the specified keys.
EX006 check_exposure_has_owner Exposures must have owner information populated.

Lineage (LI)#

Code Check Description
LI001 check_lineage_permitted_upstream_models Upstream models must have a path that matches the provided upstream_path_pattern.
LI002 check_lineage_seed_cannot_be_used Seed cannot be referenced in models with a path that matches the specified include config.
LI003 check_lineage_source_cannot_be_used Sources cannot be referenced in models with a path that matches the specified include config.

Macros (MA)#

Code Check Description
MA001 check_macro_arguments_description_populated Macro arguments must have a populated description.
MA002 check_macro_code_does_not_contain_regexp_pattern The raw code for a macro must not match the specified regexp pattern.
MA003 check_macro_description_populated Macros must have a populated description.
MA004 check_macro_has_meta_keys The meta config for macros must have the specified keys.
MA005 check_macro_is_used Macros must be invoked by at least one other resource.
MA006 check_macro_max_number_of_arguments Macros may not have more than the specified number of arguments.
MA007 check_macro_max_number_of_lines Macros may not have more than the specified number of lines.
MA008 check_macro_name_matches_file_name Macros names must be the same as the file they are contained in.
MA009 check_macro_names Macros must have a name that matches the supplied regex.
MA010 check_macro_property_file_location Macro properties files must follow the guidance provided by dbt here.

Metadata (ME)#

Code Check Description
ME001 check_project_name Enforce that the name of the dbt project matches a supplied regex. Generally used to enforce that project names conform to something like company_<DOMAIN>.

Models (MO)#

Code Check Description
MO001 check_model_access Models must have the specified access attribute.
MO002 check_model_contract_enforced_for_public_model Public models must have contracts enforced.
MO003 check_model_grant_privilege Model can have grant privileges that match the specified pattern.
MO004 check_model_grant_privilege_required Model must have the specified grant privilege.
MO005 check_model_has_contracts_enforced Model must have contracts enforced.
MO006 check_model_number_of_grants Model can have the specified number of privileges.
MO007 check_model_code_does_not_contain_regexp_pattern The raw code for a model must not match the specified regexp pattern.
MO008 check_model_does_not_use_select_star Models must not use SELECT *.
MO009 check_model_hard_coded_references A model must not contain hard-coded table references; use ref() or source() instead.
MO010 check_model_has_semi_colon Model may not end with a semi-colon (;).
MO011 check_model_incremental_has_unique_key Incremental models must declare a unique_key.
MO012 check_model_materialization_permitted Models must use a permitted materialization for their location.
MO013 check_model_max_number_of_lines Models may not have more than the specified number of lines.
MO014 check_model_columns_have_meta_keys Columns defined for models must have the specified keys in the meta config.
MO015 check_model_columns_have_relationship_tests Columns matching a regex pattern must have a relationships test, optionally validating the target column and model.
MO016 check_model_columns_have_types Columns defined for models must have a data_type declared.
MO017 check_model_has_constraints Table and incremental models must have the specified constraint types defined.
MO018 check_model_single_primary_key Models must have at most one column-level primary key constraint.
MO019 check_column_descriptions_are_consistent The same column name must not have conflicting descriptions across models.
MO020 check_model_description_contains_regexp_pattern Models must have a description that matches the provided pattern.
MO021 check_model_description_populated Models must have a populated description.
MO022 check_model_documentation_coverage Set the minimum percentage of models that have a populated description.
MO023 check_model_documented_in_same_directory Models must be documented in the same directory where they are defined (i.e. .yml and .sql files are in the same directory).
MO024 check_model_directories Only specified sub-directories are permitted.
MO025 check_model_file_name Models must have a file name that matches the supplied regex.
MO026 check_model_property_file_location Model properties files must follow the configured layout.
MO027 check_model_schema_name Models must have a schema name that matches the supplied regex.
MO028 check_model_depends_on_macros Models must depend on the specified macros.
MO029 check_model_depends_on_multiple_sources Models cannot reference more than one source.
MO030 check_model_has_exposure Models must have an exposure.
MO031 check_model_has_no_upstream_dependencies Identify if models have no upstream dependencies as this likely indicates hard-coded tables references.
MO032 check_model_materialization_by_fanout Heavily-reused models must use a durable materialization.
MO033 check_model_max_chained_views Models cannot have more than the specified number of upstream dependents that are not tables.
MO034 check_model_max_fanout Models cannot have more than the specified number of downstream models.
MO035 check_model_max_upstream_dependencies Limit the number of upstream dependencies a model has.
MO036 check_model_has_labels_keys The labels config for models must have the specified keys.
MO037 check_model_has_meta_keys The meta config for models must have the specified keys.
MO038 check_model_names Models must have a name that matches the supplied regex.
MO039 check_model_has_tags Models must have the specified tags.
MO040 check_model_has_tests_by_name Models must have a minimum number of tests matching the specified test names.
MO041 check_model_has_tests_by_type Models must have at least the specified number of schema tests and data tests.
MO042 check_model_has_unique_test Models must have a test for uniqueness of a column.
MO043 check_model_has_unit_tests Models must have more than the specified number of unit tests.
MO044 check_model_test_coverage Set the minimum percentage of models that have at least one test.
MO045 check_model_latest_version_specified Check that the latest_version attribute of the model is set.
MO046 check_model_version_allowed Check that the version of the model matches the supplied regex pattern.
MO047 check_model_version_pinned_in_ref Check that the version of the model is always specified in downstream nodes.
MO048 check_model_does_not_directly_join_to_source Models cannot reference a source and a model at the same time.
MO049 check_model_does_not_rejoin_upstream_concepts Models cannot join back to an upstream concept that one of their other parents already depends on.
MO050 check_model_min_downstream_models Models must be referenced by at least the specified number of downstream models.
MO051 check_model_has_properties_file Models must be declared in a properties file, i.e. a .yml file.
MO052 check_model_does_not_use_cartesian_join Models must not perform Cartesian or CROSS JOINs.
MO053 check_model_column_has_specified_test Columns declared in a model's properties file that match the specified regexp pattern must have a specified test.
MO054 check_model_column_description_populated Columns declared in a model's properties file must have a populated description.
MO055 check_model_column_name_complies_to_column_type Columns with the specified regexp naming pattern must have declared data types that comply to the specified regexp pattern or list of data types.
MO056 check_model_column_type_complies_to_column_name Columns with the specified declared data type must have names that comply to the specified regexp pattern.
MO057 check_model_column_names Columns declared in a model's properties file must have a name that matches the supplied regex.
MO058 check_model_alias Models must have an explicit alias and/or an alias that matches the supplied regex.

Run results (RR)#

Code Check Description
RR001 check_run_results_max_execution_time Each result can take a maximum duration (seconds).
RR002 check_run_results_max_gigabytes_billed Each result can have a maximum number of gigabytes billed.

Seeds (SE)#

Code Check Description
SE001 check_seed_column_names Seed columns must have names that match the supplied regex.
SE002 check_seed_columns_have_types Columns defined for seeds must have a data_type declared.
SE003 check_seed_description_populated Seeds must have a populated description.
SE004 check_seed_has_meta_keys The meta config for seeds must have the specified keys.
SE005 check_seed_has_unit_tests Seeds must have more than the specified number of unit tests.
SE006 check_seed_names Seed must have a name that matches the supplied regex.

Semantic models (SM)#

Code Check Description
SM001 check_semantic_model_based_on_non_public_models Semantic models should be based on public models only.

Snapshots (SN)#

Code Check Description
SN001 check_snapshot_description_populated Snapshots must have a populated description.
SN002 check_snapshot_has_meta_keys The meta config for snapshots must have the specified keys.
SN003 check_snapshot_has_tags Snapshots must have the specified tags.
SN004 check_snapshot_has_unique_key Snapshots must have a unique_key configured.
SN005 check_snapshot_names Snapshots must have a name that matches the supplied regex.
SN006 check_snapshot_strategy Snapshots must use an allowed strategy and have the required strategy-specific configuration.

Sources (SO)#

Code Check Description
SO001 check_source_description_populated Sources must have a populated description.
SO002 check_source_file_name Sources must have a file name that matches the supplied regex.
SO003 check_source_property_file_location Source properties files must follow the guidance provided by dbt here.
SO004 check_source_freshness_populated Sources must have a populated freshness.
SO005 check_duplicate_sources Sources must not share the same database relation.
SO006 check_source_min_downstream_models Sources must be referenced by at least the specified number of models.
SO007 check_source_not_orphaned Sources must be referenced in at least one model.
SO008 check_source_used_by_models_in_same_directory Sources can only be referenced by models that are located in the same directory where the source is defined.
SO009 check_source_used_by_only_one_model Each source can be referenced by a maximum of one model.
SO010 check_source_loader_populated Sources must have a populated loader.
SO011 check_source_has_labels_keys The labels config for sources must have the specified keys.
SO012 check_source_has_meta_keys The meta config for sources must have the specified keys.
SO013 check_source_pii_meta Source columns matching a PII pattern must carry a governance meta key.
SO014 check_source_names Sources must have a name that matches the supplied regex.
SO015 check_source_has_tags Sources must have the specified tags.
SO016 check_source_has_tests Sources must have a minimum number of tests.
SO017 check_source_top_level_description_populated Sources must have a populated description on the top-level sources: entry.

Tests (TE)#

Code Check Description
TE001 check_test_has_meta_keys The meta config for data tests must have the specified keys.
TE002 check_test_has_tags Data tests must have the specified tags.
TE003 check_test_has_where_config Data tests must have a where config set.

Unit tests (UT)#

Code Check Description
UT001 check_unit_test_coverage Set the minimum percentage of models that have a unit test.
UT002 check_unit_test_expect_format Unit tests can only use the specified formats.
UT003 check_unit_test_given_formats Unit tests can only use the specified formats.