amoghrajesh commented on code in PR #66735:
URL: https://github.com/apache/airflow/pull/66735#discussion_r3225755312


##########
task-sdk/src/airflow/sdk/execution_time/task_runner.py:
##########
@@ -1325,22 +1326,24 @@ def _on_term(signum, frame):
                 # Send update only if value changed (e.g., user set context 
variables during execution)
                 if ti.rendered_map_index and ti.rendered_map_index != 
previous_rendered_map_index:
                     
SUPERVISOR_COMMS.send(msg=SetRenderedMapIndex(rendered_map_index=ti.rendered_map_index))
-            finally:
-                log.info("::group::Post Execute")
 
         _push_xcom_if_needed(result, ti, log)
 
         msg, state = _handle_current_task_success(context, ti)
     except DownstreamTasksSkipped as skip:
+        log.info("::group::Post Execute")

Review Comment:
   Maybe adding a small helper for this would be nicer?



##########
task-sdk/src/airflow/sdk/execution_time/task_runner.py:
##########
@@ -1325,22 +1326,24 @@ def _on_term(signum, frame):
                 # Send update only if value changed (e.g., user set context 
variables during execution)
                 if ti.rendered_map_index and ti.rendered_map_index != 
previous_rendered_map_index:
                     
SUPERVISOR_COMMS.send(msg=SetRenderedMapIndex(rendered_map_index=ti.rendered_map_index))
-            finally:
-                log.info("::group::Post Execute")

Review Comment:
   In the older code, the finally ran after the else block, so 
`_render_map_index` on the success path ran before `::group::Post Execute`. In 
this code, `log.info("::group::Post Execute")` is placed after `result = 
_execute_task` but before the else block, so `_render_map_index` now runs 
inside the Post Execute group on the success path.
   
   Just flagging in case.



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