pankajkoti commented on code in PR #35597:
URL: https://github.com/apache/airflow/pull/35597#discussion_r1390984854


##########
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:
   Has it been discussed somewhere already as to whether we want to raise an 
error when the job may have deliberately been cancelled by the user?
   Just unsure if we want to raise an error in such scenarios, looking for more 
thoughts.



-- 
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]

Reply via email to