Adam Bloom
06/29/2023, 6:06 PMDbtCli
. I created an interesting scenario that doesn't make sense to me. dbt is erroring on a model, but the asset materialization is still successful (no assets are yielded at least, which is correct for an error). Assets from load_assets_from_dbt_manifest
did not behave this way. Does this behavior need to be setup explicitly now? I don't see the new resource ever raising DagsterDbtCliHandledRuntimeError
or a new equivalent.Adam Bloom
06/29/2023, 6:11 PMis_successful
now - looks like that might do the trick?rex
06/29/2023, 6:13 PMDbtCliTask
that’s created by DbtCli.cli(...)
has this information from is_successful()
• And we essentially defer behavior to whatever happens in the underlying CLI process here: https://docs.getdbt.com/reference/exit-codes
• The reason why we did this was we didn’t want to implicitly assume what should happen in this error scenario, especially when there are already levers to customize this behavior (e.g. --fail-fast
(link), --warn-error-options
(link)).Adam Bloom
06/29/2023, 6:14 PMcli_task = dbt.cli(
args,
manifest=manifest,
context=context,
)
yield from cli_task.stream()
if not cli_task.is_successful():
raise Exception("dbt command failed")
rex
06/29/2023, 6:14 PMAdam Bloom
06/29/2023, 6:14 PMrex
06/29/2023, 6:16 PMAdam Bloom
06/29/2023, 6:18 PMcapture_logs
? I'm not sure I actually want it compared to just using stdout logs capture - need to mull that over. I suppose it's trivial to build myself via stream_raw_events
rex
06/29/2023, 6:19 PMAdam Bloom
06/29/2023, 6:19 PMrex
06/29/2023, 6:22 PMSean Lopp
06/29/2023, 6:36 PMrex
06/30/2023, 5:25 PMraise_on_error=False
to .cli(…)
(e.g. .cli(…, raise_on_error=False)
https://github.com/dagster-io/dagster/pull/15055Adam Bloom
06/30/2023, 8:20 PMrex
06/30/2023, 8:21 PM