static_analysis
The static_analysis config is available in the dbt Fusion engine only. It isn't available in dbt Core and will be ignored. To upgrade to Fusion, refer to Get started with Fusion.
- Project YAML file
- Properties YAML file
- SQL file config
models:
resource-path:
+static_analysis: strict | baseline | off
models:
- name: model_name
config:
static_analysis: strict | baseline | off
{{ config(static_analysis='strict' | 'baseline' | 'off') }}
select
user_id,
my_cool_udf(ip_address) as cleaned_ip
from {{ ref('my_model') }}
Definition
You can configure if and when the dbt Fusion engine performs static SQL analysis for a model. Configure the static_analysis config in your project YAML file (dbt_project.yml), model properties YAML file, or in a SQL config block in your model file. Refer to Priciples of static analysis for more information on the different modes of static analysis.
Setting a model to strict does not automatically set strict for downstream models; they keep the project default unless you configure them explicitly. For more information and examples, refer to strict mode inheritance.
The following values are available for static_analysis:
baseline(default): Statically analyze SQL. This is the recommended starting point for users transitioning from dbt Core, providing a smooth migration experience while still catching most SQL errors. You can incrementally opt-in to stricter analysis over time.strict(previouslyon): Statically analyze all SQL before execution begins. Use this for maximum validation guarantees — nothing runs until the entire project is proven valid.off: Skip SQL analysis for this model and its descendants.
The on and unsafe values are deprecated and will be removed in May 2026. Use strict instead.
How static analysis modes cascade
Two rules determine how static_analysis modes apply in a lineage:
- Eligibility rule: A model is eligible for static analysis only if all of its "parents" are eligible (by parents, we mean the models that are upstream of the current model in the lineage).
- Strictness rule: A "child" model cannot be stricter than its parent (by child, we mean the models that are downstream of the current model in the lineage).
The static analysis configuration cascades from most strict to least strict. Here's the strictness hierarchy:
strict → baseline → off
Allowed downstream by parent mode
When going downstream in your lineage, you can keep the same mode or relax it; but you cannot make a child stricter than its parent. The following table shows the allowed downstream modes by parent mode:
For example, for the lineage Model A → Model B → Model C:
- If Model A is
baseline, you cannot set Model B tostrict - If Model A is
strict, you can set Model B tobaseline
This makes sure that stricter validation requirements don't apply downstream when parent models haven't met those requirements.
Refer to the Fusion concepts page for deeper discussion and visuals: New concepts. For more info on the JSON schema, refer to the dbt-jsonschema file.
CLI override
You can override model-level configuration for a run using the following CLI flags. For example, to disable static analysis for a run:
dbt run --static-analysis off # disable static analysis for all models
dbt run --static-analysis baseline # use baseline analysis for all models
Examples
The following examples show how to disable static analysis for all models in a package, for a single model, and for a model that uses a custom UDF.
- Disable static analysis for all models in a package
- Disable static analysis in YAML for a single model
- Disable static analysis in SQL for a model using a custom UDF
Disable static analysis for all models in a package
This example shows how to disable static analysis for all models in a package. The + prefix applies the config to all models in the package.
name: jaffle_shop
models:
jaffle_shop:
marts:
+materialized: table
a_package_with_introspective_queries:
+static_analysis: off
Disable static analysis in YAML for a single model
This example shows how to disable static analysis for a single model in YAML.
models:
- name: model_with_static_analysis_off
config:
static_analysis: off
Disable static analysis in SQL for a model using a custom UDF
This example shows how to disable static analysis for a model using a custom user-defined function (UDF) in a SQL file.
{{ config(static_analysis='off') }}
select
user_id,
my_cool_udf(ip_address) as cleaned_ip
from {{ ref('my_model') }}
Considerations
- Disabling static analysis means that features of the VS Code extension that depend on SQL comprehension will be unavailable.
- Static analysis might fail in some cases (for example, dynamic SQL constructs or unrecognized UDFs) and may require setting
static_analysis: off. For more examples, refer to When should I turn static analysis off?.
Was this page helpful?
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.