KoviAnusha commented on code in PR #58354:
URL: https://github.com/apache/airflow/pull/58354#discussion_r2532853085
##########
airflow-core/src/airflow/api_fastapi/execution_api/routes/task_instances.py:
##########
@@ -254,10 +254,18 @@ def ti_run(
)
if dag := dag_bag.get_dag_for_run(dag_run=dr, session=session):
+ # Create a minimal TaskInstance-like object with the required
attributes
+ class TIProxy:
+ def __init__(self, task_id: str, map_index: int, run_id: str):
+ self.task_id = task_id
+ self.map_index = map_index
+ self.run_id = run_id
+
+ ti_proxy = TIProxy(ti.task_id, ti.map_index, ti.run_id)
upstream_map_indexes = dict(
_get_upstream_map_indexes(
serialized_dag=dag,
- ti=ti,
+ ti=ti_proxy,
Review Comment:
ti=ti can't be used because TaskInstanceLike protocol expects attribute
access (ti.task_id), but SQLAlchemy Row objects use dictionary-like access
(ti['task_id'] or ti.task_id through special methods).
--
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]