https://prefect.io logo
Title
p

Paul Lucas

08/03/2022, 12:45 PM
Hi I’ve managed to get a POC for Prefect up and running in Heroku but issue I have now is that when I go to run the flow that run dbt, it doesn’t appear to be picking up the env var for the dbt target and is instead falling back on the dev one. I’m currently creating a task like so
dbt_shell_task = DbtShellTask(
    profiles_dir=str(DBT_PROFILES_DIR),
    environment=str(DBT_TARGET),
    overwrite_profiles=False,
    helper_script=f"cd {DBT_ROOT}",
    return_all=True,
    stream_output=True,
    state_handlers=[post_to_slack],
)
If I run dbt outside Prefect, i.e.
dbt build --target=$DBT_TARGET
it works as expected. Am I using the wrong variable for
target
?
a

Anna Geller

08/03/2022, 2:37 PM
If you are building a Prefect PoC now, you should use Prefect 2.0 instead - 2.0 is LTS, 1.0 is in maintenance mode
check out this collection for dbt https://github.com/PrefectHQ/prefect-dbt
p

Paul Lucas

08/04/2022, 8:45 AM
Thank you @Anna Geller I started this poc before 2.0 was released but it had occurred to me that I should upgrade. Since I’ve signed up to prefect cloud, would I need a separate cloud account for 2.0 or can I upgrade the current 1.0 one?
a

Anna Geller

08/04/2022, 9:43 AM
Yup, there is a new Cloud :cloud2: use the link app.prefect.cloud to sign up
🙌 1