ashb commented on code in PR #47339:
URL: https://github.com/apache/airflow/pull/47339#discussion_r1987147249


##########
task-sdk/src/airflow/sdk/execution_time/task_runner.py:
##########
@@ -578,6 +541,19 @@ def run(
     ti: RuntimeTaskInstance, log: Logger
 ) -> tuple[IntermediateTIState | TerminalTIState, ToSupervisor | None, 
BaseException | None]:
     """Run the task in this process."""
+    # First, clear the xcom data
+    if ti._ti_context_from_server and 
ti._ti_context_from_server.xcom_keys_to_clear:
+        keys_to_delete = ti._ti_context_from_server.xcom_keys_to_clear

Review Comment:
   Nit? (Not sure which is better actually) 
   ```suggestion
       if ti._ti_context_from_server and (keys_to_delete := 
ti._ti_context_from_server.xcom_keys_to_clear):
   ```
   
   
   However putthingb this above the imports and setup feels wrong. This should 
be move to inside the try block I think



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