diff --git a/providers/src/airflow/providers/standard/sensors/time_delta.py b/providers/src/airflow/providers/standard/sensors/time_delta.py index 8e0f26ac249dd..4380a2c1a8e62 100644 --- a/providers/src/airflow/providers/standard/sensors/time_delta.py +++ b/providers/src/airflow/providers/standard/sensors/time_delta.py @@ -24,7 +24,6 @@ from packaging.version import Version from airflow.configuration import conf -from airflow.exceptions import AirflowSkipException from airflow.providers.standard.triggers.temporal import DateTimeTrigger, TimeDeltaTrigger from airflow.providers.standard.utils.version_references import AIRFLOW_V_3_0_PLUS from airflow.sensors.base import BaseSensorOperator @@ -89,15 +88,10 @@ def execute(self, context: Context) -> bool | NoReturn: if timezone.utcnow() > target_dttm: # If the target datetime is in the past, return immediately return True - try: - if AIRFLOW_V_3_0_PLUS: - trigger = DateTimeTrigger(moment=target_dttm, end_from_trigger=self.end_from_trigger) - else: - trigger = DateTimeTrigger(moment=target_dttm) - except (TypeError, ValueError) as e: - if self.soft_fail: - raise AirflowSkipException("Skipping due to soft_fail is set to True.") from e - raise + if AIRFLOW_V_3_0_PLUS: + trigger = DateTimeTrigger(moment=target_dttm, end_from_trigger=self.end_from_trigger) + else: + trigger = DateTimeTrigger(moment=target_dttm) # todo: remove backcompat when min airflow version greater than 2.11 timeout: int | float | timedelta diff --git a/providers/src/airflow/providers/standard/triggers/external_task.py b/providers/src/airflow/providers/standard/triggers/external_task.py index 3571230caf8fe..a28e6ae042b79 100644 --- a/providers/src/airflow/providers/standard/triggers/external_task.py +++ b/providers/src/airflow/providers/standard/triggers/external_task.py @@ -23,8 +23,8 @@ from asgiref.sync import sync_to_async from sqlalchemy import func -from airflow.sensors.base import FailPolicy from airflow.models import DagRun +from airflow.sensors.base import FailPolicy from airflow.providers.standard.utils.sensor_helper import _get_count from airflow.providers.standard.utils.version_references import AIRFLOW_V_3_0_PLUS from airflow.triggers.base import BaseTrigger, TriggerEvent