Farid
05/30/2024, 11:45 AMtrigger_dbt_cli_command
, into the prefect logs in the most recent version of prefect_dbt
, e.g. 0.5.0
?
For example, in the prefect-dbt==0.3.1
dbt and prefect used to stream the output of dbt command runs made by trigger_dbt_cli_command
function. However that's not the case in the most recent version.Oscar Björhn
05/30/2024, 1:24 PMFarid
05/30/2024, 11:22 PMfrom prefect_dbt.cli.commands import DbtCoreOperation
dbt_run = DbtCoreOperation(
commands=["dbt run"],
stream_output=True,
# dbt_cli_profile=dbt_cli_profile_block,
# overwrite_profiles=True,
# project_dir=DBT_REPO_LOCAL_PATH,
)
dbt_run.run()
This is not perfect, e.g. the stream output is not coloured and has redundant text with every message.
however the docs clearly doesn't recommend this for "long-lasting operations" , instead it requires using this as context manager but I didn't not get the logs in that way either.
God I miss the old version...Sean Williams
05/31/2024, 8:32 PMtrigger_dbt_cli_command
to use programmatic invocation of dbt commands in 0.5.0
. Part of that change allowed us to create a summary artifact, with an example in the screenshot here: https://github.com/PrefectHQ/prefect/releases/tag/2.19.1
This is not the same as streaming logs, but it does have some extra information not found in logs, like the compiled code of failed tests for quicker debugging.Oscar Björhn
06/03/2024, 2:45 PMSean Williams
06/03/2024, 2:56 PM