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


##########
airflow-core/src/airflow/models/taskinstance.py:
##########
@@ -203,6 +203,33 @@ def _stop_remaining_tasks(*, task_instance: TaskInstance, 
task_teardown_map=None
             log.info("Not skipping teardown task '%s'", ti.task_id)
 
 
+def _add_and_prime_mapped_ti(
+    ti: TaskInstance,
+    task: Operator,
+    dag_run: DagRun,
+    *,
+    session: Session,
+    context_carrier: dict | None = None,
+) -> None:
+    """
+    Attach a newly-created mapped TI to the session and prime its ``dag_run`` 
cache.
+
+    Used by mapped-task expansion (``TaskMap.expand_mapped_task``,
+    ``DagRun._revise_map_indexes_if_mapped``) to persist a brand-new mapped TI 
without
+    the per-row SELECT that ``session.merge()`` would issue, and to prime 
``dag_run`` so
+    a later ``ti.get_dagrun()`` during dependency evaluation is a cache hit 
rather than
+    another per-TI SELECT.

Review Comment:
   removed the comment



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