-
Notifications
You must be signed in to change notification settings - Fork 2
/
dbt-bouncer-example.yml
166 lines (156 loc) · 5.36 KB
/
dbt-bouncer-example.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
# custom_checks_dir: my_checks # [Optional] Directory where custom checks are stored.
dbt_artifacts_dir: dbt_project/target # [Optional] Directory where the dbt artifacts exists, generally the `target` directory inside a dbt project. Defaults to `./target`.
# exclude: ^models/staging # [Optional] Here for demonstration purposes only
# include: ^models/marts # [Optional] Here for demonstration purposes only
# severity: warn # [Optional] Useful when applying `dbt-bouncer` to an existing dbt project.
catalog_checks:
- name: check_column_description_populated
include: ^models/marts
- name: check_column_name_complies_to_column_type
column_name_pattern: ^is_.*
exclude: ^models/staging
types:
- BOOLEAN
- name: check_column_name_complies_to_column_type
column_name_pattern: .*_date$
include: ^models/staging # Not a good idea, here for demonstration purposes only
types:
- DATE
- name: check_column_name_complies_to_column_type
column_name_pattern: ^[a-z_]*$
types:
- BIGINT
- BOOLEAN
- DATE
- DOUBLE
- INTEGER
- VARCHAR
- name: check_column_has_specified_test
column_name_pattern: ^is_.*
test_name: not_null
- name: check_columns_are_all_documented
include: ^models/marts
- name: check_columns_are_documented_in_public_models
- name: check_source_columns_are_all_documented
exclude: ^models/staging/crm # Not a good idea, here for demonstration purposes only
manifest_checks:
# Exposures
- name: check_exposure_based_on_non_public_models
- name: check_exposure_based_on_view
# Lineage
- name: check_lineage_permitted_upstream_models
include: ^models/staging
upstream_path_pattern: $^
- name: check_lineage_permitted_upstream_models
include: ^models/intermediate
upstream_path_pattern: ^models/staging|^models/intermediate
- name: check_lineage_permitted_upstream_models
include: ^models/marts
upstream_path_pattern: ^models/staging|^models/intermediate
- name: check_lineage_seed_cannot_be_used
include: ^models/intermediate|^models/marts
- name: check_lineage_source_cannot_be_used
include: ^models/intermediate|^models/marts
# Macros
- name: check_macro_arguments_description_populated
- name: check_macro_code_does_not_contain_regexp_pattern
regexp_pattern: .*[i][f][n][u][l][l].*
- name: check_macro_description_populated
- name: check_macro_max_number_of_lines
- name: check_macro_name_matches_file_name
- name: check_macro_property_file_location
# Metadata
- name: check_project_name
project_name_pattern: ^dbt_bouncer_
# Models
- name: check_model_access
include: ^models/intermediate
access: protected
severity: warn
- name: check_model_access
include: ^models/marts
access: public
- name: check_model_access
include: ^models/staging
access: protected
- name: check_model_code_does_not_contain_regexp_pattern
regexp_pattern: .*[i][f][n][u][l][l].*
- name: check_model_contract_enforced_for_public_model
- name: check_model_depends_on_multiple_sources
- name: check_model_description_populated
- name: check_model_directories
include: ^models
permitted_sub_directories:
- intermediate
- marts
- staging
- utilities
- name: check_model_directories
include: ^models/staging
permitted_sub_directories:
- crm
- payments
- name: check_model_documentation_coverage
- name: check_model_documented_in_same_directory
- name: check_model_has_contracts_enforced
include: ^models/marts
- name: check_model_has_meta_keys
keys:
- maturity
- name: check_model_has_no_upstream_dependencies
include: ^((?!int_*).)*$
exclude: ^models/utilities/time_spines
- name: check_model_has_tags
include: ^models/staging/crm
tags:
- crm
- name: check_model_has_unique_test
- name: check_model_max_chained_views
- name: check_model_max_fanout
max_downstream_models: 2
- name: check_model_max_number_of_lines
- name: check_model_max_upstream_dependencies
- name: check_model_has_unit_tests
include: ^models/marts
- name: check_model_names
include: ^models/intermediate
model_name_pattern: ^int_
- name: check_model_names
include: ^models/staging
model_name_pattern: ^stg_
- name: check_model_test_coverage
- name: check_model_property_file_location
# Semantic models
- name: check_semantic_model_based_on_non_public_models
# Sources
- name: check_source_description_populated
- name: check_source_freshness_populated
- name: check_source_loader_populated
- name: check_source_has_meta_keys
keys:
- contact:
- email
- slack
- owner
- name: check_source_has_tags
tags:
- example_tag
- name: check_source_names
source_name_pattern: >
^[a-z0-9_]*$
- name: check_source_not_orphaned
include: ^models/staging/crm
- name: check_source_property_file_location
- name: check_source_used_by_models_in_same_directory
- name: check_source_used_by_only_one_model
# Unit tests
- name: check_unit_test_coverage
include: ^models/marts
- name: check_unit_test_expect_format
- name: check_unit_test_given_formats
run_results_checks:
# Not a good idea, here for demonstration purposes only
- name: check_run_results_max_execution_time
include: ^models/staging
exclude: ^models/staging/crm
max_execution_time_seconds: 10