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/11/21 06:58:12 UTC
[GitHub] [airflow] uranusjr commented on a diff in pull request #27775: [misc] Get rid of `pass` statement in conditions
uranusjr commented on code in PR #27775:
URL: https://github.com/apache/airflow/pull/27775#discussion_r1027636610
##########
airflow/providers/amazon/aws/hooks/batch_client.py:
##########
@@ -363,10 +363,8 @@ def get_job_description(self, job_id: str) -> dict:
return self.parse_job_description(job_id, response)
except botocore.exceptions.ClientError as err:
- error = err.response.get("Error", {})
- if error.get("Code") == "TooManyRequestsException":
- pass # allow it to retry, if possible
- else:
+ # Allow it to retry in case of exceeded quota limit of requests to AWS API
+ if err.response.get("Error", {}).get("Code") != "TooManyRequestsException":
raise AirflowException(f"AWS Batch job ({job_id}) description error: {err}")
Review Comment:
I feel this block can be deleted entirely. Coercing the exception to AirflowException is not particularly useful.
--
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