Timo
09/06/2022, 1:39 PMprefect-dbt
's trigger_dbt_cli_command()
inside another task?
This does not work for async
tasks.
ThanksNate
09/06/2022, 2:18 PM@flow
def my_dbt_flow():
trigger_dbt_cli_command()
@flow
def parent_flow():
my_dbt_flow()
I wouldn't recommend using Task.fn
to retrieve the standard python callable from your task here, because even then you're not calling a task within a task, you're only calling a task's python function and so it won't behave like a prefect taskTimo
09/06/2022, 2:21 PM.fn()
call. But is this is not working for the async functions. Therefore I asked my question.
Maybe to be more precise: Is it possible to call the underlying function of a async task?Nate
09/06/2022, 2:24 PM.fn()
outside of testing scenarios because you lose all orchestration functionality that comes with prefect tasks, since you're no longer calling a prefect task (only the task's python function)
that said it is technically possible to call trigger_dbt_cli_command.fn()
from within a task, sync or asyncTimo
09/06/2022, 2:29 PMRuntimeWarning: coroutine 'trigger_dbt_cli_command' was never awaited
trigger_dbt_cli_command.fn(
RuntimeWarning: Enable tracemalloc to get the object allocation traceback
Nate
09/06/2022, 2:30 PMTimo
09/06/2022, 2:45 PMasync
aswell then it works. thank you