ccorleis commented on code in PR #35597:
URL: https://github.com/apache/airflow/pull/35597#discussion_r1391019330
##########
airflow/providers/dbt/cloud/operators/dbt.py:
##########
@@ -189,15 +188,13 @@ def execute(self, context: Context):
return self.run_id
def execute_complete(self, context: Context, event: dict[str, Any]) -> int:
- """
- Execute when the trigger fires - returns immediately.
-
- Relies on trigger to throw an exception, otherwise it assumes
execution was successful.
- """
- if event["status"] == "error":
- raise AirflowException(event["message"])
- self.log.info(event["message"])
+ """Execute when the trigger fires - returns immediately."""
self.run_id = event["run_id"]
+ if event["status"] == "cancelled":
+ raise DbtCloudJobRunException(f"Job run {self.run_id} has been
cancelled.")
Review Comment:
It currently works like this in the non-deferrable mode. I also think it
makes sense to prevent the start of any following tasks or DAGs when the dbt
job gets cancelled.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]