This is an automated email from the ASF dual-hosted git repository.

jscheffl pushed a commit to branch v2-10-test
in repository https://gitbox.apache.org/repos/asf/airflow.git


The following commit(s) were added to refs/heads/v2-10-test by this push:
     new e2974872f5e Store rendered_map_index from TaskInstancePydantic into 
TaskInstance (#48571)
e2974872f5e is described below

commit e2974872f5eccdffd4043eaf7b6acc570238c218
Author: AutomationDev85 <[email protected]>
AuthorDate: Mon Mar 31 18:51:59 2025 +0200

    Store rendered_map_index from TaskInstancePydantic into TaskInstance 
(#48571)
    
    Co-authored-by: AutomationDev85 <AutomationDev85>
---
 airflow/models/taskinstance.py    | 1 +
 tests/models/test_taskinstance.py | 5 ++++-
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/airflow/models/taskinstance.py b/airflow/models/taskinstance.py
index 9aebd40f6c9..fdadd1f5554 100644
--- a/airflow/models/taskinstance.py
+++ b/airflow/models/taskinstance.py
@@ -830,6 +830,7 @@ def _set_ti_attrs(target, source, include_dag_run=False):
     target.next_kwargs = source.next_kwargs
     if source.note and isinstance(source, TaskInstancePydantic):
         target.note = source.note
+        target.rendered_map_index = source.rendered_map_index
 
     if include_dag_run:
         target.execution_date = source.execution_date
diff --git a/tests/models/test_taskinstance.py 
b/tests/models/test_taskinstance.py
index f7a2f3b4144..eacf02997d6 100644
--- a/tests/models/test_taskinstance.py
+++ b/tests/models/test_taskinstance.py
@@ -5457,7 +5457,7 @@ def 
test_taskinstance_with_note_pydantic(create_task_instance, session):
         executor=ti.executor,
         executor_config=None,
         updated_at=timezone.utcnow(),
-        rendered_map_index=ti.rendered_map_index,
+        rendered_map_index="ti with rendered_map_index",
         external_executor_id="x",
         trigger_id=ti.trigger_id,
         trigger_timeout=timezone.utcnow(),
@@ -5485,6 +5485,9 @@ def 
test_taskinstance_with_note_pydantic(create_task_instance, session):
     ti_note: TaskInstanceNote = 
session.query(TaskInstanceNote).filter_by(**filter_kwargs).one()
     assert ti_note.content == "ti with note"
 
+    ti: TaskInstance = 
session.query(TaskInstance).filter_by(**filter_kwargs).one()
+    assert ti.rendered_map_index == "ti with rendered_map_index"
+
 
 def test__refresh_from_db_should_not_increment_try_number(dag_maker, session):
     with dag_maker():

Reply via email to