enabled
- Models
- Seeds
- Snapshots
- Tests
- Unit tests
- Sources
- Metrics
- Exposures
- Semantic models
- Saved queries
models:
<resource-path>:
+enabled: true | false
{{ config(
enabled=true | false
) }}
select ...
seeds:
<resource-path>:
+enabled: true | false
snapshots:
<resource-path>:
+enabled: true | false
# Configuring in a SQL file is a legacy method and not recommended. Use the YAML file instead.
{% snapshot snapshot_name %}
{{ config(
enabled=true | false
) }}
select ...
{% endsnapshot %}
data_tests:
<resource-path>:
+enabled: true | false
{% test <testname>() %}
{{ config(
enabled=true | false
) }}
select ...
{% endtest %}
{{ config(
enabled=true | false
) }}
unit_tests:
<resource-path>:
+enabled: true | false
unit_tests:
- name: [<test-name>]
config:
enabled: true | false
sources:
<resource-path>:
+enabled: true | false
metrics:
<resource-path>:
+enabled: true | false
version: 2
metrics:
- name: [<metric-name>]
config:
enabled: true | false
exposures:
<resource-path>:
+enabled: true | false
version: 2
exposures:
- name: [<exposure-name>]
config:
enabled: true | false
semantic-models:
<resource-path>:
+enabled: true | false
semantic_models:
- name: [<semantic_model_name>]
config:
enabled: true | false
saved-queries:
<resource-path>:
+enabled: true | false
saved_queries:
- name: [<saved_query_name>]
config:
enabled: true | false
Definition
An optional configuration for enabling or disabling a resource.
- Default: true
When a resource is disabled, dbt will not consider it as part of your project. Note that this can cause compilation errors.
If you instead want to exclude a model from a particular run, consider using the --exclude
parameter as part of the model selection syntax
If you are disabling models because they are no longer being used, but you want to version control their SQL, consider making them an analysis instead.
Examples
Disable a model in a package in order to use your own version of the model.
This could be useful if you want to change the logic of a model in a package. For example, if you need to change the logic in the segment_web_page_views
from the segment
package (original model):
- Add a model named
segment_web_page_views
(the same name) to your own project. - To avoid a compilation error due to duplicate models, disable the segment package's version of the model like so:
models:
segment:
base:
segment_web_page_views:
+enabled: false
Was this page helpful?
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.