ephraimbuddy commented on code in PR #54505:
URL: https://github.com/apache/airflow/pull/54505#discussion_r2287594803


##########
airflow-core/src/airflow/api_fastapi/core_api/routes/public/extra_links.py:
##########
@@ -28,8 +28,8 @@
 from airflow.api_fastapi.core_api.datamodels.extra_links import 
ExtraLinkCollectionResponse
 from airflow.api_fastapi.core_api.openapi.exceptions import 
create_openapi_http_exception_doc
 from airflow.api_fastapi.core_api.security import DagAccessEntity, 
requires_access_dag
-from airflow.exceptions import TaskNotFound
 from airflow.models import DagRun
+from airflow.sdk.exceptions import TaskNotFound

Review Comment:
   The issue here is that the API server calls `dag.get_task` which raises the 
sdk TaskNotFound. Now if you have a duplicate TaskNotFound in core and try to 
catch the sdk TaskNotFound, it doesn’t work. The TaskNotFound in sdk is a 
different object than the one in core, 
[here](https://github.com/apache/airflow/blob/591c39b8520846200f209d273b4e37d7b961bbb2/airflow-core/src/airflow/api_fastapi/core_api/routes/public/extra_links.py#L66),
 what's raised is the sdk TaskNotFound and we can't catch the exception with 
the TaskNoFound duplicate in core
   



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