Skip to main content

full_refresh

The full_refresh config allows you to control whether a resource will always or never perform a full-refresh. This config overrides the --full-refresh command-line flag.

dbt_project.yml
models:
<resource-path>:
+full_refresh: false | true
models/<modelname>.sql

{{ config(
full_refresh = false | true
) }}

select ...

Description

The full_refresh config allows you to optionally configure whether a resource will always or never perform a full-refresh. This config is an override for the --full-refresh command line flag used when running dbt commands.

You can set the full_refresh config in the dbt_project.yml file or in a resource config.

full_refresh valueBehavior
If set to trueThe resource always performs a full refresh, regardless of whether you pass the --full-refresh flag in the dbt command.
If set to falseThe resource never performs a full refresh, regardless of whether you pass the --full-refresh flag in the dbt command.
If set to none or omittedThe resource follows the behavior of the --full-refresh flag. If the flag is used, the resource will perform a full refresh; otherwise, it will not.

Note

  • The --full-refresh flag also supports a short name, -f.
  • The should_full_refresh() macro has logic encoded.

Usage

Incremental models

Seeds

The columns of my seed changed, and now I get an error when running the `seed` command, what should I do?

Recommendation

Set full_refresh: false for models of especially large datasets, which you would never want dbt to fully drop and recreate.

Reference docs

Was this page helpful?

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

0