turbaszek commented on a change in pull request #9475:
URL: https://github.com/apache/airflow/pull/9475#discussion_r444742601



##########
File path: airflow/api_connexion/endpoints/extra_link_endpoint.py
##########
@@ -15,12 +15,41 @@
 # specific language governing permissions and limitations
 # under the License.
 
-# TODO(mik-laj): We have to implement it.
-#     Do you want to help? Please look at: 
https://github.com/apache/airflow/issues/8140
+from flask import current_app
 
+from airflow import DAG
+from airflow.api_connexion.exceptions import NotFound
+from airflow.exceptions import TaskNotFound
+from airflow.models.dagbag import DagBag
+from airflow.models.dagrun import DagRun as DR
+from airflow.utils.session import provide_session
 
-def get_extra_links():
+
+@provide_session
+def get_extra_links(dag_id: str, dag_run_id: str, task_id: str, session):
     """
     Get extra links for task instance
     """
-    raise NotImplementedError("Not implemented yet.")
+    dagbag: DagBag = current_app.dag_bag
+    dag: DAG = dagbag.get_dag(dag_id)
+    if not dag:
+        raise NotFound("DAG not found", detail=f'DAG with ID = "{dag_id}" not 
found')

Review comment:
       Should we create `DagNotFound` and `TaskNotFound` exceptions to unify 
this between endpoints? 




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

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to