Hello, when using <DBT software-defined-asset>, is...
# ask-community
t
Hello, when using DBT software-defined-asset, is there a way to trigger a full refresh of my incremental models ?
y
cc @owen
o
hi @Timothee Vandeput! when configuring your dbt_cli_resource, you can pass in
{... (other config options) ..., "full-refresh": True}
y
@Dagster Bot discussion How to trigger a full refresh of dbt incremental models with software-defined assets
d
Question in the thread has been surfaced to GitHub Discussions for future discoverability: https://github.com/dagster-io/dagster/discussions/8873
t
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
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
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
nice! that looks great