Skip to content

Add map_index_template support for mapped task group (#40799)#61975

Open
anishgirianish wants to merge 2 commits intoapache:mainfrom
anishgirianish:support-map-index-template-for-mapped-task-groups
Open

Add map_index_template support for mapped task group (#40799)#61975
anishgirianish wants to merge 2 commits intoapache:mainfrom
anishgirianish:support-map-index-template-for-mapped-task-groups

Conversation

@anishgirianish
Copy link
Copy Markdown
Contributor

@anishgirianish anishgirianish commented Feb 16, 2026


Was generative AI tooling used to co-author this PR?
  • Yes (please specify the tool below)

Summary

This adds map_index_template support to @task_group, so all child tasks in a mapped task group show meaningful labels instead of numeric indexes.

image
  @task_group(map_index_template="{{ filename }}")
  def file_transforms(filename):
      extracted = extract(filename)
      load(extracted)

Testing

  • Unit tests across all layers (decorator, serialization, API, task runner)
  • Manual E2E in breeze with three scenarios: basic chained tasks, task-level precedence, and partial() + expand()

closes #40799.

  • Read the Pull Request Guidelines for more information. Note: commit author/co-author name and email in commits become permanently public when merged.
  • For fundamental code changes, an Airflow Improvement Proposal (AIP) is needed.
  • When adding dependency, check compliance with the ASF 3rd Party License Policy.
  • For significant user-facing changes create newsfragment: {pr_number}.significant.rst or {issue_number}.significant.rst, in airflow-core/newsfragments.

Copy link
Copy Markdown
Collaborator

@Dev-iL Dev-iL left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good overall! Could benefit from some (docstring-level) clarifications.

@anishgirianish anishgirianish force-pushed the support-map-index-template-for-mapped-task-groups branch from d9355cb to 048094d Compare February 16, 2026 07:28
@anishgirianish
Copy link
Copy Markdown
Contributor Author

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!

@anishgirianish anishgirianish force-pushed the support-map-index-template-for-mapped-task-groups branch 3 times, most recently from 315cfe9 to 1274622 Compare February 22, 2026 01:59
@anishgirianish anishgirianish force-pushed the support-map-index-template-for-mapped-task-groups branch 2 times, most recently from 7adddf2 to 74f30af Compare March 14, 2026 09:48
@anishgirianish anishgirianish force-pushed the support-map-index-template-for-mapped-task-groups branch from 74f30af to d17e67c Compare March 21, 2026 05:26
@anishgirianish anishgirianish force-pushed the support-map-index-template-for-mapped-task-groups branch from d17e67c to 6c637be Compare March 21, 2026 23:42
@uranusjr
Copy link
Copy Markdown
Member

How is this different from setting the template on the tasks instead?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support named mapping for task group

3 participants