Tomas Moreno
03/29/2024, 8:50 PM[0m20:39:10 Encountered an error:
Compilation Error
dbt found 3 package(s) specified in packages.yml, but only 0 package(s) installed in dbt_packages. Run "dbt deps" to install package dependencies.
here's my command
trigger_dbt_cli_command.with_options(name=f"transform").submit(
command=f"dbt run --models some_model",
profiles_dir=dir,
project_dir=dir,
)
I see the dbt deps get installed when I build my docker container so not quite sure what's happeningSean Williams
03/29/2024, 8:55 PMTomas Moreno
03/29/2024, 8:59 PMSean Williams
03/29/2024, 9:01 PMDbtCoreOperation
because you can supply more than one dbt command, and manage the dependencies that way.
from prefect_dbt.cli.commands import DbtCoreOperation
from prefect import flow
@flow
def trigger_dbt_flow() -> str:
result = DbtCoreOperation(
commands=["dbt deps", "dbt build -t prod"],
project_dir="prefect_demo",
profiles_dir="~/.dbt"
).run()
return result
if __name__ == "__main__":
trigger_dbt_flow()
Tomas Moreno
03/29/2024, 9:16 PMSean Williams
03/29/2024, 9:37 PMTomas Moreno
03/29/2024, 9:42 PMTomas Moreno
03/29/2024, 9:42 PMTomas Moreno
03/29/2024, 9:46 PM--target prod
to my commands list?Sean Williams
03/29/2024, 9:50 PMprofiles.yml
file is the default. You only need to supply a target if you have additional targets and you want to override the defaultTomas Moreno
03/29/2024, 10:01 PMSean Williams
03/29/2024, 10:03 PMSean Williams
03/29/2024, 10:07 PMprofiles.yml
in prod, or supply the target flagTomas Moreno
03/29/2024, 10:11 PMTomas Moreno
03/29/2024, 10:11 PMSean Williams
03/29/2024, 10:11 PMSean Williams
03/29/2024, 10:11 PMSean Williams
03/29/2024, 10:12 PMTomas Moreno
04/01/2024, 1:52 PM