kaxil commented on code in PR #49809:
URL: https://github.com/apache/airflow/pull/49809#discussion_r2066007139


##########
task-sdk/src/airflow/sdk/execution_time/task_runner.py:
##########
@@ -826,7 +829,17 @@ def run(
                 state = TerminalTIState.FAILED
                 return state, msg, error
 
-            result = _execute_task(context, ti, log)
+            try:
+                result = _execute_task(context, ti, log)
+            except Exception:
+                import jinja2
+
+                # If the task failed, swallow rendering error so it doesn't 
mask the main error.
+                with contextlib.suppress(jinja2.TemplateSyntaxError, 
jinja2.UndefinedError):
+                    ti.rendered_map_index = _render_map_index(context, ti=ti, 
log=log)
+                raise
+            else:  # If the task succeeded, render normally to let rendering 
error bubble up.
+                ti.rendered_map_index = _render_map_index(context, ti=ti, 
log=log)

Review Comment:
   There is a bug in `_render_map_index(` func definition -- will add a comment 
there



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