Fabien Gadet
02/28/2023, 10:48 PMbuild
from dbt using the dbt cli ressource .
i understood that if i want to do an @op
i can pass a context
parameter to use it in the function .
i tried this but it doesn't work
resources = {
"dbt": dbt_cli_resource.configured(
{
"project_dir": DBT_PROJECT_PATH,
"profiles_dir": DBT_PROFILES,
},
)
}
@op(required_resource_keys={"dbt"})
def custom_run(context):
context.build(models=["mymodel"])
The end goal is to do a custom dbt build --select mymodel+
Guy McCombe
03/01/2023, 2:24 PM@op(required_resource_keys={"dbt"})
def custom_run(context):
context.resources.dbt.build(models=["mymodel"])
Fabien Gadet
03/01/2023, 2:57 PMGuy McCombe
03/01/2023, 2:57 PM