How to keep dbt asset materialization for successfully materialized assets for failed runs? #17735
-
Assume dbt asset consisting of two models
I'm looking for a way to retain dbt asset materialization for successful assets and record run failure. In this case run status would be |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
You could raise a @dbt_assets(manifest=Path("target", "manifest.json"))
def my_dbt_assets(context: AssetExecutionContext, dbt: DbtCliResource):
dbt_run_invocation = dbt.cli(["run"], context=context, raise_on_error=False)
yield from dbt_run_invocation.stream()
if not dbt_run_invocation.is_successful():
raise Failure(description="partial success") |
Beta Was this translation helpful? Give feedback.
You could raise a
Failure
in the body of your computation.