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


##########
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:
   I’ve updated the code to iterate over "session.execute(query).scalars()" 
instead, which works across both 1.4 and 2.0, removes version checks, and still 
just iterates the results. All CI lanes are successful.



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