https://dagster.io/ logo
#ask-community
Title
# ask-community
t

Timothee Vandeput

07/12/2022, 11:44 PM
Hello, when using DBT software-defined-asset, is there a way to trigger a full refresh of my incremental models ?
y

yuhan

07/13/2022, 8:35 PM
cc @owen
o

owen

07/13/2022, 8:41 PM
hi @Timothee Vandeput! when configuring your dbt_cli_resource, you can pass in
{... (other config options) ..., "full-refresh": True}
y

yuhan

07/13/2022, 11:17 PM
@Dagster Bot discussion How to trigger a full refresh of dbt incremental models with software-defined assets
d

Dagster Bot

07/13/2022, 11:17 PM
Question in the thread has been surfaced to GitHub Discussions for future discoverability: https://github.com/dagster-io/dagster/discussions/8873
t

Timothee Vandeput

07/14/2022, 12:44 PM
Hello Owen, thanks for the help ! It's working when I pass the full-refresh option from the ressource definition in my repository. Example :
"dbt": dbt_cli_resource.configured(
{"project_dir": DBT_PROJECT_DIR, "profiles_dir": DBT_PROFILES_DIR, "full-refresh": True}
),
I would like to do it from the launchpad as well. I tried with :
resources:
dbt:
config:
full-refresh: True
But it's not picking the flag. Any idea on how I should do it from the launchpad ?
o

owen

07/14/2022, 1:00 PM
ah it's not picking up the flag because by default, once you call .configured(), that's basically the “finalized” config for that resource. the nicest to handle this would be something like https://docs.dagster.io/concepts/configuration/configured#partially-filling-the-configuration
basically, you can replace the config schema of the dbt_cli_resource with a simpler one that only lets you configure the full refresh flag (and “bakes in” the dbt project and profile flags)
t

Timothee Vandeput

07/14/2022, 4:19 PM
Thanks a lot for the support @owen. For reference, I managed to do it with the following code :
@configured(dbt_cli_resource, config_schema={"full-refresh": bool})
def dbt_configuration(config):
return {"project_dir": DBT_PROJECT_DIR, "profiles_dir": DBT_PROFILES_DIR, "full-refresh": config["full-refresh"]}
And then specifying my new configuration for DBT in my ressource definition :
"dbt": dbt_configuration
I can now use the following configuration in the launchpad :
resources:
dbt:
config:
full-refresh: true
o

owen

07/14/2022, 4:19 PM
nice! that looks great