Michael Holvey
09/29/2022, 2:32 AMfrom prefect import flow
from prefect_dbt.cli.commands import trigger_dbt_cli_command
@flow
def run_dbt() -> str:
result = trigger_dbt_cli_command("dbt run", project_dir='C:\\Users\\36350admin\\arrow_dbt-1')
return result
run_dbt()
It even tells me it's running this dbt command, and when I run that by itself in the same working directory, it works as expected!
22:29:08.084 | INFO | Task run 'trigger_dbt_cli_command-321ca940-0' - Running dbt command: dbt run --profiles-dir C:\Users\36350admin\.dbt --project-dir C:\Users\36350admin\arrow_dbt-1
Jeff Hale
09/29/2022, 8:38 PMAndrew Huang
09/30/2022, 4:20 PMdbt debug
?Michael Holvey
09/30/2022, 7:48 PMdbt debug
as well as specified my profiles_dir param - and the paths that Prefect is returning are all messed/not valid paths at all.
Using profiles.yml file at C:\Users\36350admin\prefect\Users36350admin.dbt\profiles.yml
Using dbt_project.yml file at C:\Users\36350admin\prefect\Users36350adminarrow_dbt-1\dbt_project.yml
Updated code:
from prefect import flow
from prefect_dbt.cli.commands import trigger_dbt_cli_command
@flow(name="dbt")
def run_dbt() -> str:
result = trigger_dbt_cli_command(command="dbt debug",
project_dir="C:\\Users\\36350admin\\arrow_dbt-1",
profiles_dir="C:\\Users\\36350admin\\.dbt"
)
return result
run_dbt()
Andrew Huang
10/03/2022, 8:02 PMAndrew Huang
10/03/2022, 8:04 PM