uranusjr commented on code in PR #38902:
URL: https://github.com/apache/airflow/pull/38902#discussion_r1560385357


##########
airflow/models/taskinstance.py:
##########
@@ -2715,29 +2727,26 @@ def signal_handler(signum, frame):
 
             # Execute the task
             with set_current_context(context):
-                result = self._execute_task(context, task_orig)
+                result, rendered_map_index = self._execute_task(context, 
task_orig, jinja_env=jinja_env)

Review Comment:
   I wonder if we should just try to render the template _regardless_ of the 
task at all. Something like
   
   ```python
   def _render_map_index(...):
       ...
   
   try:
       result = self._execute_task(context, task_orig)
   except Exception:
       # If the task failed, swallow rendering error so it doesn't mask the 
main error.
       with contextlib.suppress(jinja2.TemplateSyntaxError, 
jinja2.UndefinedError):
           _render_map_index(...)
       raise
   else:
       # If the task succeeded, render normally to let rendering error bubble 
up.
       _render_map_index(...)
   ```



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