uranusjr commented on code in PR #33424:
URL: https://github.com/apache/airflow/pull/33424#discussion_r1298036356
##########
airflow/sensors/base.py:
##########
@@ -281,6 +282,16 @@ def run_duration() -> float:
self.log.info("Success criteria met. Exiting.")
return xcom_value
+ def resume_execution(self, next_method: str, next_kwargs: dict[str, Any] |
None, context: Context):
+ try:
+ return super().resume_execution(next_method, next_kwargs, context)
+ except (AirflowException, TaskDeferralError) as e:
+ if self.soft_fail:
+ raise AirflowSkipException(str(e))
Review Comment:
```suggestion
raise AirflowSkipException(str(e)) from e
```
(I think we do this in many places)
##########
airflow/sensors/base.py:
##########
@@ -281,6 +282,16 @@ def run_duration() -> float:
self.log.info("Success criteria met. Exiting.")
return xcom_value
+ def resume_execution(self, next_method: str, next_kwargs: dict[str, Any] |
None, context: Context):
+ try:
+ return super().resume_execution(next_method, next_kwargs, context)
+ except (AirflowException, TaskDeferralError) as e:
+ if self.soft_fail:
+ raise AirflowSkipException(str(e))
+ raise
+ except Exception:
+ raise
Review Comment:
```suggestion
```
Since this block only catch and re-raise the same exception, it doesn’t need
to exist at all…?
##########
airflow/sensors/base.py:
##########
@@ -281,6 +282,16 @@ def run_duration() -> float:
self.log.info("Success criteria met. Exiting.")
return xcom_value
+ def resume_execution(self, next_method: str, next_kwargs: dict[str, Any] |
None, context: Context):
+ try:
+ return super().resume_execution(next_method, next_kwargs, context)
+ except (AirflowException, TaskDeferralError) as e:
+ if self.soft_fail:
+ raise AirflowSkipException(str(e))
+ raise
+ except Exception:
+ raise
Review Comment:
```suggestion
```
Since this block only catch and re-raise the same exception, it doesn’t need
to exist at all…?
--
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]