Add map_index_template support for mapped task group (#40799)#61975
Add map_index_template support for mapped task group (#40799)#61975anishgirianish wants to merge 2 commits intoapache:mainfrom
Conversation
airflow-core/src/airflow/api_fastapi/execution_api/routes/task_instances.py
Show resolved
Hide resolved
| XComModel.task_id == operator.task_id, | ||
| XComModel.run_id == run_id, | ||
| XComModel.key == key, | ||
| XComModel.map_index == -1, |
There was a problem hiding this comment.
Does this mean the group's expand input can't depend on mapped upstream task outputs? If so, this should be documented as a limitation.
There was a problem hiding this comment.
Great question! From what I can tell, the upstream producing the expand input is unmapped; it returns a list that drives the mapping. If it were mapped, it would go through expand_kwargs instead, so it wouldn't be a SchedulerXComArg here. But I'd love to hear if you've seen a case where this breaks,
There was a problem hiding this comment.
I'm not that familiar with xcom intricacies - perhaps it's worth adding a test that ensures this scenario works correctly.
airflow-core/src/airflow/api_fastapi/execution_api/routes/task_instances.py
Show resolved
Hide resolved
Dev-iL
left a comment
There was a problem hiding this comment.
Looks good overall! Could benefit from some (docstring-level) clarifications.
airflow-core/src/airflow/api_fastapi/execution_api/routes/task_instances.py
Show resolved
Hide resolved
d9355cb to
048094d
Compare
|
Thank you so much for the thorough review, @Dev-iL. I've addressed all the feedback, applied your match/case refactor, simplified the schema, added the iteration order comment, and added debug logging. Would really appreciate a re-review when you get a chance! |
Was generative AI tooling used to co-author this PR?
Summary
This adds
map_index_templatesupport to@task_group, so all child tasks in a mapped task group show meaningful labels instead of numeric indexes.Testing
closes #40799.
{pr_number}.significant.rstor{issue_number}.significant.rst, in airflow-core/newsfragments.