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 ...
  • If full_refresh:true — the configured resources(s) will full-refresh when dbt run --full-refresh is invoked.
  • If full_refresh:false — the configured resources(s) will not full-refresh when dbt run --full-refresh is invoked.

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.

full_refresh valueBehavior
trueThe resource always full-refreshes, regardless of the presence or absence of the --full-refresh flag.
falseThe resource never full-refreshes, even if the --full-refresh flag is provided.
none or omittedThe resource follows the behavior of the --full-refresh flag. If the flag is used, the resource will full-refresh; otherwise, it won't.

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

0