eladkal commented on code in PR #26932:
URL: https://github.com/apache/airflow/pull/26932#discussion_r990754081
##########
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'm not sure i follow?
You suggest to change the code to `AirflowFailException` which means no
retries.
https://github.com/apache/airflow/blob/7efdeed5eccbf5cb709af40c8c66757e59c957ed/airflow/exceptions.py#L87-L88
> in this particular case, you want to retry your tasks as it is an issue
"external" to your query.
This is exactly why I don't believe `AirflowFailException` is right here.
`AirflowFailException` fits for cases where you must make code changes to
your DAG. This is not the case here. The operator is querying database.
Resolution can come from the DB side without any code changes.
--
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]