manipatnam commented on PR #67551:
URL: https://github.com/apache/airflow/pull/67551#issuecomment-4545453053

   Tested using the following DAG:
   
   ```python
   from datetime import datetime
   
   from airflow.decorators import dag, task
   
   
   @dag(
       dag_id="dynamic_mapped_dag",
       start_date=datetime(2026, 1, 1),
       schedule=None,
       catchup=False,
       tags=["dynamic", "mapped"],
   )
   def dynamic_mapped_dag():
       @task
       def generate_indexes() -> list[int]:
           return list(range(126))
   
       @task
       def process(index: int) -> int:
           print(f"Processing map_index={index}")
           return index
   
       @task(map_index_template="{{ user }}")
       def process_labeled(user: str) -> str:
           print(f"Processing user={user}")
           return user
   
       process.expand(index=generate_indexes())
       process_labeled.expand(user=["zebra", "apple", "mango", "cherry", 
"banana"])
   
   
   dynamic_mapped_dag()
   ```
   
   ---
   
   # Task: `process`
   
   ## Before this PR (including #66008 fix)
   
   ### Default view
   ![Default 
view](https://github.com/user-attachments/assets/12fdf372-c3e0-4705-8fa0-4df5cfd5322c)
   
   ### When sorted ascending
   ![Sorted 
ascending](https://github.com/user-attachments/assets/f3add879-a018-49ba-a697-d25e104186cb)
   
   ### When sorted descending
   ![Sorted 
descending](https://github.com/user-attachments/assets/a28f4927-7cb9-43c8-ad05-732ff22b178a)
   
   ---
   
   ## Using the code in this PR (also includes #66008 fix)
   
   ### Default behaviour when no filter is applied
   ![Default 
behaviour](https://github.com/user-attachments/assets/5f56f3e4-c793-41dd-8562-8b4b5b010031)
   
   ### When sorted ascending
   ![Sorted 
ascending](https://github.com/user-attachments/assets/d233c62f-43b0-4bd1-8c41-d4c7f6dd5f48)
   
   ### When sorted descending
   ![Sorted 
descending](https://github.com/user-attachments/assets/7cbe7d5d-07a0-4018-bf2b-2faafa13556d)
   
   ### Default behaviour when `map_index` 124 and 123 are retried
   ![Retry 
behaviour](https://github.com/user-attachments/assets/6ef03465-0424-4c73-a6f5-6f3a761093b5)
   
   ---
   
   # Task: `process_labeled` (Nothing changed)
   
   ## Before this PR (including #66008 fix)
   
   ### Default view
   ![Default 
view](https://github.com/user-attachments/assets/cc207ba2-7439-401c-aa93-4c0b1040f545)
   
   ### When sorted ascending
   ![Sorted 
ascending](https://github.com/user-attachments/assets/91a7ac5a-46fb-4381-b215-02ac708f95e6)
   
   ### When sorted descending
   ![Sorted 
descending](https://github.com/user-attachments/assets/cbacd74b-4c05-4634-99fb-d434b9d411bc)
   
   ### Default view when `map_index` `cherry` and `mango` are retried
   ![Retry 
behaviour](https://github.com/user-attachments/assets/4d278403-0d29-4197-b5c2-78a3881f702c)
   
   ---
   
   ## Using the code in this PR (also includes #66008 fix)
   
   ### Default behaviour when no filter is applied
   ![Default 
behaviour](https://github.com/user-attachments/assets/d8e2f7a2-dca0-405d-94fe-7783f4a5d914)
   
   ### When sorted ascending
   ![Sorted 
ascending](https://github.com/user-attachments/assets/4adef959-10a1-493b-9e3a-69d9689380c4)
   
   ### When sorted descending
   ![Sorted 
descending](https://github.com/user-attachments/assets/081520c4-f415-4ce9-9aa7-6e53ff6b3d02)
   
   ### Default behaviour when `map_index` `cherry` and `mango` are retried
   ![Retry 
behaviour](https://github.com/user-attachments/assets/d9601560-50e3-4485-b103-ec2f735dc6de)


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