Display key in dynamic task mapping using dict in UI view of Mapped Tasks' map index
- Dominant language
- Python
- Stars
- 46.9k
- Forks
- 17.8k
- Avg merge
- 2d 10h
- Merged PRs (30d)
- 483
Description
### Apache Airflow version
2.9.0
### If "Other Airflow 2 version" selected, which one?
_No response_
### What happened?
As per the confluence wiki, dynamic task mapping [users will have an option to click on any generated task (e.g. run_after_loop[0], run_after_loop[1] **or run_after_loop[key] if the map function is iterating over a dictionary**)](https://cwiki.apache.org/confluence/display/AIRFLOW/AIP-42+Dynamic+Task+Mapping) (emphasis mine).
However, if I use dynamic task mapping with `.expand()` over a dictionary, the UI view Mapped Tasks still shows a numerical Map Index for the sub-tasks.
### What you think should happen instead?
It would be nice if it might instead pick up on keys from such dictionary inputs such that one would not have to manually specify `map_index_template` (alongside setting such a key in the context).
### How to reproduce
- `.expand()` over a dictionary
- open an operator's web UI view Mapped Tasks
- find a numerical Map Index for the sub-tasks
### Operating System
ChromeOS
### Versions of Apache Airflow Providers
_No response_
### Deployment
Docker-Compose
### Deployment details
_No response_
### 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)
Contributor guide
Research direction
Reproduce the issue in Apache Airflow 2.9.0 by using .expand() over a dictionary and opening the operator's Mapped Tasks UI view. Trace how the map index is displayed and make the result use dictionary keys without requiring map_index_template; verify the numerical index is replaced in the UI.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- data-engineering, web-dev
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100