eladkal commented on code in PR #34199:
URL: https://github.com/apache/airflow/pull/34199#discussion_r1319576218
##########
airflow/providers/common/sql/sensors/sql.py:
##########
@@ -96,19 +96,37 @@ def poke(self, context: Any):
records = hook.get_records(self.sql, self.parameters)
if not records:
if self.fail_on_empty:
- raise AirflowException("No rows returned, raising as per
fail_on_empty flag")
+ # TODO: remove this if block when min_airflow_version is set
to higher than 2.7.1
+ message = "No rows returned, raising as per fail_on_empty flag"
+ if self.soft_fail:
+ raise AirflowSkipException(message)
+ raise AirflowException(message)
Review Comment:
I think it's cleaner to have it like:
https://github.com/apache/airflow/blob/47bd5dd0e1e13af45206b94dd5518ada278a9552/airflow/providers/amazon/aws/log/s3_task_handler.py#L36-L42
--
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]