kaxil commented on code in PR #52968:
URL: https://github.com/apache/airflow/pull/52968#discussion_r2190827088


##########
task-sdk/src/airflow/sdk/execution_time/context.py:
##########
@@ -272,7 +273,12 @@ class ConnectionAccessor:
     """Wrapper to access Connection entries in template."""
 
     def __getattr__(self, conn_id: str) -> Any:
-        return _get_connection(conn_id)
+        try:
+            return _get_connection(conn_id)
+        except AirflowRuntimeError as e:
+            if e.error.error == ErrorType.CONNECTION_NOT_FOUND:
+                raise AirflowNotFoundException(f"The conn_id `{conn_id}` isn't 
defined") from None
+            raise

Review Comment:
   We should just change this to use `airflow.sdk.Connection.get` to remove 
this code duplication.
   



-- 
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]

Reply via email to