You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- [Configuring exceptions to the rules](#configuring-exceptions-to-the-rules)
81
79
82
-
__[Querying the DAG with SQL](#querying-the-dag-with-sql)__
80
+
### [Querying the DAG with SQL](#querying-the-dag-with-sql)
83
81
84
-
__[Limitations](#limitations)__
82
+
### [Limitations](#limitations)
85
83
- [BigQuery and Databricks](#bigquery-and-databricks)
86
84
87
-
__[Contributing](#contributing)__
85
+
### [Contributing](#contributing)
88
86
89
87
----
90
88
@@ -859,6 +857,54 @@ vars:
859
857
860
858
Changing `max_depth_dag` number to a higher one might prevent the package from running properly on BigQuery and Databricks/Spark.
861
859
860
+
861
+
### Configuring exceptions to the rules
862
+
863
+
While the rules defined in this package are considered best practices, we realize that there might be exceptions to those rules and people might want to exclude given results to get passing tests despite not following all the recommendations.
864
+
865
+
An example would be excluding all models with names matching with `stg_..._unioned` from `fct_multiple_sources_joined` as we might want to union 2 different tables representing the same data in some of our staging models and we don't want the test to fail for those models.
866
+
867
+
The package offers the ability to define a seed called `dbt_project_evaluator_exceptions.csv` to list those exceptions we don't want to be reported. This seed must contain the following columns:
868
+
- `fct_name`: the name of the fact table for which we want to define exceptions (Please note that it is not possible to exclude specific models for all the `coverage` tests, but there are variables available to configure those to the particular users' needs)
869
+
- `column_name`: the column name from `fct_name` we will be looking at to define exceptions
870
+
- `id_to_exclude`: the values (or `like` pattern) we want to exclude for `column_name`
871
+
- `comment`: a field where people can document why a given exception is legitimate
872
+
873
+
The following section describes the steps to follow to configure exceptions.
874
+
875
+
#### 1. Create a new seed
876
+
877
+
With our previous example, the seed `dbt_project_evaluator_exceptions.csv` would look like:
878
+
```
879
+
fct_name,column_name,id_to_exclude,comment
880
+
fct_multiple_sources_joined,child,stg_%_unioned,Models called _unioned can union multiple sources
881
+
```
882
+
883
+
which looks like the following when loaded in the warehouse
|fct_multiple_sources_joined|child |stg\_%\_unioned |Models called \_unioned can union multiple sources|
888
+
889
+
890
+
#### 2. Deactivate the seed from the original package
891
+
892
+
Only a single seed can exist with a given name. When using a custom one, we need to deactivate the one from the package by adding the following to our `dbt_project.yml`
893
+
```
894
+
seeds:
895
+
dbt_project_evaluator:
896
+
dbt_project_evaluator_exceptions:
897
+
+enabled: false
898
+
```
899
+
900
+
#### 3. Run the seed and the package
901
+
902
+
We then run both the seed and the package by executing the following command:
0 commit comments