Prasanth345 commented on code in PR #55194:
URL: https://github.com/apache/airflow/pull/55194#discussion_r2322191173
##########
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:
Actually, i tried iterating directly over query, but in SQLAlchemy 2.0
get_many() can return a Select, which isn’t iterable.
https://github.com/apache/airflow/actions/runs/17464086653/job/49596173768?pr=55194
TypeError: 'Select' object is not iterable
--
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]