You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "uranusjr (via GitHub)" <gi...@apache.org> on 2023/08/10 08:11:25 UTC

[GitHub] [airflow] uranusjr commented on a diff in pull request #33196: respect soft_fail argument when ExternalTaskSensor runs in deferrable mode

uranusjr commented on code in PR #33196:
URL: https://github.com/apache/airflow/pull/33196#discussion_r1289738390


##########
airflow/sensors/base.py:
##########
@@ -330,6 +330,16 @@ def reschedule(self):
     def get_serialized_fields(cls):
         return super().get_serialized_fields() | {"reschedule"}
 
+    def raise_failed_or_skiping_exception(self, failed_message: str, skipping_message: str = "") -> None:
+        """Raise AirflowSkipException if self.soft_fail is set to True. Otherwise raise AirflowException."""
+        if self.soft_fail:
+            if skipping_message:
+                message = skipping_message
+            else:
+                message = failed_message
+            raise AirflowSkipException(message)

Review Comment:
   ```suggestion
               raise AirflowSkipException(skipping_message or failed_message)
   ```



-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org