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 7634890c6b7 Fixed setting rendered_map_index only if set (#49057)
7634890c6b7 is described below

commit 7634890c6b74a44f613136a29c175d1d185e2bd9
Author: AutomationDev85 <[email protected]>
AuthorDate: Fri Apr 11 17:25:29 2025 +0200

    Fixed setting rendered_map_index only if set (#49057)
    
    Co-authored-by: AutomationDev85 <AutomationDev85>
---
 airflow/models/taskinstance.py | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/airflow/models/taskinstance.py b/airflow/models/taskinstance.py
index fdadd1f5554..755a4685203 100644
--- a/airflow/models/taskinstance.py
+++ b/airflow/models/taskinstance.py
@@ -828,8 +828,11 @@ def _set_ti_attrs(target, source, include_dag_run=False):
     target.trigger_id = source.trigger_id
     target.next_method = source.next_method
     target.next_kwargs = source.next_kwargs
+    # These checks are required to make sure that note and rendered_map_index 
are not
+    # reset during refresh_from_db as DB still contains None values and would 
reset the fields
     if source.note and isinstance(source, TaskInstancePydantic):
         target.note = source.note
+    if source.rendered_map_index and isinstance(source, TaskInstancePydantic):
         target.rendered_map_index = source.rendered_map_index
 
     if include_dag_run:

Reply via email to