ashb commented on code in PR #55194:
URL: https://github.com/apache/airflow/pull/55194#discussion_r2321828885


##########
airflow-core/src/airflow/api_fastapi/core_api/routes/public/extra_links.py:
##########
@@ -87,6 +87,33 @@ def get_extra_links(
     )
     all_extra_links = {link_name: link_url or None for link_name, link_url in 
sorted(all_extra_link_pairs)}
 
+    from airflow.models.xcom import XComModel
+
+    query = XComModel.get_many(
+        dag_ids=dag_id,
+        run_id=dag_run_id,
+        task_ids=task_id,
+        map_indexes=map_index,
+    ).filter(XComModel.key.like("_link_%"))
+
+    link_map = {}
+    if hasattr(task, "operator_extra_links"):
+        link_map = {
+            getattr(link, "xcom_key", link.name).removeprefix("_link_"): 
link.name
+            for link in getattr(task, "operator_extra_links", [])
+        }
+
+    if hasattr(query, "all"):
+        rows = query.all()
+    else:
+        rows = session.execute(query).scalars().all()
+
+    for row in rows:

Review Comment:
   You can just iterate over the query set can't you?
   
   ```suggestion
       for row in query:
   ```



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