dstandish commented on code in PR #63568:
URL: https://github.com/apache/airflow/pull/63568#discussion_r2975780542


##########
airflow-core/src/airflow/models/taskmap.py:
##########
@@ -254,6 +268,18 @@ def expand_mapped_task(
             task.log.debug("Expanding TIs upserted %s", ti)
             task_instance_mutation_hook(ti)
             ti = session.merge(ti)
+            if unmapped_ti:
+                dr = unmapped_ti.dag_run
+            else:
+                from airflow.models import DagRun
+
+                dr = session.scalar(
+                    select(DagRun).where(
+                        DagRun.dag_id == task.dag_id,
+                        DagRun.run_id == run_id,
+                    )
+                )

Review Comment:
   yeah so, that's only when there's not an unmapped TI --- do you know when 
that happens? i was not sure we really needed that block. because the method is 
"expand_mapped_task" -- so, why wouldn't we have an unmappd_ti?



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