Slackbot
08/24/2024, 12:10 PMMarvin
08/24/2024, 12:11 PMdbttargetproddevdbtShellTaskpython
from prefect import flow, task
from prefect.tasks.shell import ShellTask
run_dbt = ShellTask(return_all=True)
@task
def run_dbt_with_target(target):
    command = f"dbt run --target {target}"
    return run_dbt(command=command)
@flow
def my_dbt_flow(target: str):
    result = run_dbt_with_target(target)
    print(result)
# Run the flow with the desired target
my_dbt_flow(target="prod")ShellTaskdbt--target