You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "Lee-W (via GitHub)" <gi...@apache.org> on 2023/09/28 06:16:17 UTC

[GitHub] [airflow] Lee-W commented on a diff in pull request #34652: Fix `dag.test()` and Respect 'soft_fail' argument when running ExternalTaskSensor

Lee-W commented on code in PR #34652:
URL: https://github.com/apache/airflow/pull/34652#discussion_r1339583073


##########
airflow/sensors/external_task.py:
##########
@@ -163,9 +163,11 @@ def __init__(
         total_states = set(self.allowed_states + self.skipped_states + self.failed_states)
 
         if len(total_states) != len(self.allowed_states) + len(self.skipped_states) + len(self.failed_states):
-            raise AirflowException(
-                "Duplicate values provided across allowed_states, skipped_states and failed_states."
-            )
+            # TODO: remove this if block when min_airflow_version is set to higher than 2.7.1
+            message = "Duplicate values provided across allowed_states, skipped_states and failed_states."
+            if self.soft_fail:
+                raise AirflowSkipException(message)
+            raise AirflowException(message)

Review Comment:
   In addition to that, I think https://github.com/apache/airflow/pull/33424 also handles it and that's why we have the TODO in providers but not in the core.



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