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


##########
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:
   yes, makes sense 👍🏽 



##########
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:
   yes, makes sense 👍🏽 



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