ferruzzi commented on code in PR #54299:
URL: https://github.com/apache/airflow/pull/54299#discussion_r2274462456
##########
providers/amazon/src/airflow/providers/amazon/aws/hooks/base_aws.py:
##########
@@ -621,19 +617,12 @@ def conn_config(self) -> AwsConnectionWrapper:
if self.aws_conn_id:
try:
connection = self.get_connection(self.aws_conn_id)
- except Exception as e:
- not_found_exc_via_core = isinstance(e,
AirflowNotFoundException)
- not_found_exc_via_task_sdk = (
- AIRFLOW_V_3_0_PLUS
- and isinstance(e, AirflowRuntimeError)
- and e.error.error == ErrorType.CONNECTION_NOT_FOUND
+ except AirflowNotFoundException:
+ self.log.warning(
+ "Unable to find AWS Connection ID '%s', switching to
empty.", self.aws_conn_id
)
- if not_found_exc_via_core or not_found_exc_via_task_sdk:
- self.log.warning(
- "Unable to find AWS Connection ID '%s', switching to
empty.", self.aws_conn_id
- )
- else:
- raise
+ except Exception:
+ raise
Review Comment:
I'm not seeing the value in those two lines either. If it's anything other
than an AirflowNotFoundException then it would just raise it anyway, right?
It's kind of like `if foo: print() else: pass` the `else: pass` is implied and
redundant.
--
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]