https://dagster.io/ logo
Title
j

Jamie Lee

09/20/2022, 11:38 AM
Hi, I have an Op that is supposed to run after a DBT tests Op. However, the DBT tests Op fails and this Op doesn’t run. Is there a way for it to run even if the previous connected Op fails?
@op(
    ins={"ready": In(Nothing)},
    out=Out(dagster_type=str, asset_key=AssetKey("grant_permissions")),
    required_resource_keys={"redshift"},
    tags={"kind": "sql", **annotations},
)
def grant_table_permissions(context):
    ...
o

owen

09/20/2022, 4:12 PM
hi @Jamie Lee! By default, if the the dbt_cli_resource encounters an error while executing a dbt command, it will raise an exception (which in turn will fail the entire op). You can change this behavior, so that dbt commands returning error codes don't raise exceptions, by configuring your dbt_cli_resource with
{"ignore_handled_error": True}
. Once that's set, the dbt test op will succeed even if a test fails, allowing downstream ops to execute