https://prefect.io logo
Title
a

ale

05/08/2023, 4:33 PM
Hey folks 👋 Are there any example on how to trigger dbt core on a Redshift target? Looking at
prefect-dbt
I see the available targets are Snowflake, Bigquery and Postgres, but not Redshift. Should I use the Postgres target? Any hint is much appreciated! 🙌
1
s

Sean Williams

05/09/2023, 3:09 PM
You might be able to make the postgres settings work, but I'm not sure. I believe your best bet would be to use an existing profiles.yml file, as with the "Using an existing profile" example, here:
from prefect import flow
from prefect_dbt.cli.commands import DbtCoreOperation

@flow
def trigger_dbt_flow() -> str:
    result = DbtCoreOperation(
        commands=["pwd", "dbt debug", "dbt run"],
        project_dir="PROJECT-DIRECTORY-PLACEHOLDER",
        profiles_dir="PROFILES-DIRECTORY-PLACEHOLDER"
    ).run()
    return result

trigger_dbt_flow()
You could also request a Redshift target, here https://github.com/PrefectHQ/prefect-dbt/issues
a

ale

05/09/2023, 3:21 PM
Hey @Sean Williams 👋 Thank you very much!
👋 1
👍 1