dbt-project-evaluator 2.0.0: native dbt checks
dbt-project-evaluator 2.0.0 runs the same dbt Labs best practices (28 rules in six categories: modeling, testing, documentation, structure, performance and governance) as native dbt checks instead of models built in your warehouse.
It requires dbt 2.0 or later. If you are on dbt v1, stay on dbt-project-evaluator 1.x (the 1.x branch).
What you get
- Native. Run the rules with
dbt check, list them withdbt ls --resource-type check, and set their severity, tags or whether they run indbt_project.yml. - Checked before every build. Checks run before anything compiles on
dbt build, so a rule set toseverity: errorstops a build that breaks it. - Fast. On a project of about 1,900 models, all the checks take about 15 seconds, parsing included, against about 2 minutes for the 1.x
dbt buildon Snowflake. - Selectable.
dbt check --selectandstate:modifiedreport only the violations on the resources you changed, which is what a pull request needs. - No warehouse needed. No credentials, no compute cost, the same result on every adapter supported by dbt 2, and CI that doesn't need secrets.
Upgrading from 1.x
# packages.yml
packages:
- package: dbt-labs/dbt_project_evaluator
version: [">=2.0.0", "<3.0.0"]Convert your exceptions seed with the script that ships with the package:
python dbt_packages/dbt_project_evaluator/scripts/migrate_to_v2.pySee the migration guide for the full list of steps.
Breaking changes
- dbt >= 2.0.0 only.
- Nothing is built in the warehouse. The package no longer creates models or seeds and doesn't need
dbt_utils. Themodels:,seeds:anddispatch:configuration of the package is gone, and so are the DAG tables such asint_all_dag_relationships. To query your DAG, use the information schema, for exampledbt show --inline "select * from {{ info_schema('edges') }}". - Severity is set with
checks:indbt_project.yml, per category or per check, instead of the tests severity and theDBT_PROJECT_EVALUATOR_SEVERITYenvironment variable. Theprint_dbt_project_evaluator_issueson-run-end hook is gone. - Exceptions are a var or a macro. The
dbt_project_evaluator_exceptionsseed is replaced by the var (or macro) of the same name. An entry can also match on a column of the check, for example a parent or a pair, or be declared as a SQL condition next to the resources. - Hard-coded references are reported by
dbt lint(ruleDBT05) and not by the package anymore. - Removed variables:
insert_batch_size,max_depth_dag,comment_chars,token_costsanduse_native_agate_printing.
Other differences
- Disabled resources are ignored by all the checks.
- Sources are identified by their
unique_id: two sources with the same name in different packages are two resources. exclude_paths_from_projectis a case-sensitive substring match rather than a regular expression, and applies to the resources of all packages.fct_documentation_coverageandfct_test_coverageonly return a row when the coverage is below the target, and ignore exceptions.fct_undocumented_sourcesandfct_duplicate_sourcesreturn one row per source.fct_direct_join_to_source,fct_multiple_sources_joined,fct_model_fanoutandfct_source_fanoutreturn the names of the parents or children in a list column, not their number.
Known limitations
dbt check --selectcan't scope source rows yet (dbt-labs/dbt#16554), so the checks about sources report nothing when you pass a selector. Run them without--select.fct_missing_primary_key_testsdoesn't countnot_nullconstraints yet (dbt-labs/dbt#16553).dbt checkprints the first 5 rows of each check.scripts/show_violations.pylists all of them.- The package ships three agent skills. Until
ai_provideris set (for exampleflags: {ai_provider: claude}indbt_project.yml), dbt 2 prints anAiProviderUnsetwarning and installs none of them.