TJaniF opened a new issue, #49224:
URL: https://github.com/apache/airflow/issues/49224

   ### Apache Airflow version
   
   3.0.0
   
   ### If "Other Airflow 2 version" selected, which one?
   
   main branch
   
   ### What happened?
   
   In Airflow 2.10.5 the dag below changes the map index displayed in the UI:
   
   ```
   from airflow.decorators import dag, task
   
   @dag()
   def my_dag():
   
       @task
       def upstream_task():
           return [1, 2, 3]
   
       @task(
           map_index_template="Hello! {{ my_custom_template }}",
       )
       def map_me(x, **context):
           print(x)
   
           from airflow.operators.python import get_current_context
   
           context = get_current_context()
   
           context["my_custom_template"] = f"{x}"
   
       map_me.expand(x=upstream_task())
   
   my_dag()
   ```
   
   
   
![Image](https://github.com/user-attachments/assets/6529c866-8415-408e-9cd3-0669d10a41ce)
   
   
   In RC 2 `map_index_template` does not change the index. (no errors)
   
   ```
   from airflow.decorators import dag, task
   
   
   @dag
   def dtm():
   
       @task
       def upstream_task():
           return [1, 2, 3]
   
       @task(
           map_index_template="Hello! {{ my_custom_template }}",
       )
       def map_me(x):
           print(x)
   
           from airflow.sdk.definitions.context import get_current_context
   
           context = get_current_context()
   
           context["my_custom_template"] = f"{x}"
   
       map_me.expand(x=upstream_task())
   
   
   dtm()
   ```
   
   
![Image](https://github.com/user-attachments/assets/2a051c3f-7ef3-40bb-926a-eb9c66f6e97f)
   
   ### What you think should happen instead?
   
   _No response_
   
   ### How to reproduce
   
   Use the second dag above and run it. See the integer index in the UI.
   
   ### Operating System
   
   MacOS
   
   ### Versions of Apache Airflow Providers
   
   Breeze
   
   ### Deployment
   
   Other
   
   ### Deployment details
   
   breeze
   
   ### Anything else?
   
   _No response_
   
   ### Are you willing to submit PR?
   
   - [ ] Yes I am willing to submit a PR!
   
   ### Code of Conduct
   
   - [x] I agree to follow this project's [Code of 
Conduct](https://github.com/apache/airflow/blob/main/CODE_OF_CONDUCT.md)
   


-- 
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: commits-unsubscr...@airflow.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to