Asterios Pantousas
07/27/2023, 3:41 PMtrigger_dbt_cli_command
, each performing various CLI commands. More specifically, we run different dbt models based on certain tags.
The issue we encounter is within the Prefect UI, where these dbt tasks are automatically assigned default names (such as trigger_dbt_cli_command-0
, trigger_dbt_cli_command-1
, etc.). This automatic naming becomes problematic when a task fails, as it is difficult to discern precisely which task has encountered the error.
From the docs I didn't manage to find any solution to that. We would greatly appreciate your insight and any potential solutions to this naming issue. 😁Nate
07/27/2023, 4:28 PM.with_options
along with the runtime templating here to do something like
from prefect import flow, task
from prefect_dbt.cli.commands import trigger_dbt_cli_command
trigger_dbt = trigger_dbt_cli_command.with_options(task_run_name="Run {command}")
@flow
def foo():
trigger_dbt(command="dbt debug")
if __name__ == "__main__":
foo()
Task run 'Run dbt debug'
Asterios Pantousas
07/27/2023, 6:57 PMNate
07/27/2023, 6:58 PM