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

   ### Description
   
   The map_index_template field on a task is used to render a custom name for 
each individual sub task in a mapped task. It is generated by rendering the 
task context on the jinja template provided. It is possible to add to this 
context during the task run and therefore control the mapped index based on the 
results of the task. As a result, the rendering happens after a task run 
completes and this has the side effect that it will only render the mapped task 
for tasks that succeed.
   
   This isn't always the case though, and it would be useful to see the custom 
map index both during task runs, and for tasks that have failed. I propose that 
we render the map index twice - once before and once after the task runs. This 
would mean that the mapped index appears during the task run, and also persists 
for tasks that have failed.
   
   ### Use case/motivation
   
   It would be useful to be able to see the custom map index even for tasks 
that fail, when the context information to do so is available. This helps with 
tracking down which tasks have failed, as the mapped task index can be used to 
provide human readable information to distinguish the mapped tasks from one 
another.
   
   ### Related issues
   
   _No response_
   
   ### Are you willing to submit a PR?
   
   - [X] 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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to