You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2022/10/07 13:38:04 UTC
[GitHub] [airflow] eladkal commented on a diff in pull request #26932: The Check Operator should throw a Airflow Fail Exception instead of AirflowException when the condition is not met
eladkal commented on code in PR #26932:
URL: https://github.com/apache/airflow/pull/26932#discussion_r990100996
##########
airflow/providers/common/sql/operators/sql.py:
##########
@@ -250,7 +250,7 @@ def execute(self, context: Context):
records = hook.get_first(self.sql)
if not records:
- raise AirflowException(f"The following query returned zero rows: {self.sql}")
+ raise AirflowFailException(f"The following query returned zero rows: {self.sql}")
Review Comment:
I don't think this is right.
Retry can work for some senarios so we should not block it.
You can still get the behavior you wish by set retries=0
##########
airflow/providers/common/sql/operators/sql.py:
##########
@@ -250,7 +250,7 @@ def execute(self, context: Context):
records = hook.get_first(self.sql)
if not records:
- raise AirflowException(f"The following query returned zero rows: {self.sql}")
+ raise AirflowFailException(f"The following query returned zero rows: {self.sql}")
Review Comment:
I don't think this is right.
Retry can work for some senarios so we should not block it.
You can still get the behavior you wish by set retries=0
WDYT?
--
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