Skip to content

Commit e4a11ca

Browse files
authored
api_client: raise error when job run terminates with non-success result state
1 parent 192317e commit e4a11ca

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

dbt/adapters/databricks/api_client.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -617,6 +617,11 @@ def _handle_terminal_state(self, run: Run) -> None:
617617
self._handle_non_terminated_failure(
618618
run, life_cycle_state, state_message, result_state or ""
619619
)
620+
elif result_state not in (None, "SUCCESS", "SUCCESS_WITH_FAILURES"):
621+
raise DbtRuntimeError(
622+
f"Python model run ended in result_state {result_state}"
623+
f" (run_id: {run.run_id})\nState message: {state_message}"
624+
)
620625

621626
def cancel(self, run_id: str) -> None:
622627
logger.debug(f"Cancelling run id {run_id}")

0 commit comments

Comments
 (0)