Skip to content

How to keep dbt asset materialization for successfully materialized assets for failed runs? #17735

Answered by rexledesma
nixent asked this question in Q&A
Discussion options

You must be logged in to vote

You could raise a Failure in the body of your computation.

@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")

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by rexledesma
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
integration: dbt Related to dagster-dbt
2 participants