You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "AutomationDev85 (via GitHub)" <gi...@apache.org> on 2025/11/19 12:32:20 UTC

[PR] Deferred KubernetesPodOperator pushes XCom on successful execution. [airflow]

AutomationDev85 opened a new pull request, #58488:
URL: https://github.com/apache/airflow/pull/58488

   # Overview
   
   After upgrading to kubernetes provider 10.10.0, XCom was no longer pushed on successful execution of KubernetesPodOperator in deferrable mode. This PR restores XCom propagation for successful deferred runs.
   
   # Change Summary
   
   * Ensure `trigger_reentry` returns XCom value when `do_xcom_push` is True and execution succeeds.
   * Extend unit tests to assert XCom is returned in deferrable mode.
   
   Feedback is welcome.


-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Deferred KubernetesPodOperator pushes XCom on successful execution. [airflow]

Posted by "jscheffl (via GitHub)" <gi...@apache.org>.
jscheffl merged PR #58488:
URL: https://github.com/apache/airflow/pull/58488


-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Deferred KubernetesPodOperator pushes XCom on successful execution. [airflow]

Posted by "johnslavik (via GitHub)" <gi...@apache.org>.
johnslavik commented on code in PR #58488:
URL: https://github.com/apache/airflow/pull/58488#discussion_r2586909823


##########
providers/cncf/kubernetes/src/airflow/providers/cncf/kubernetes/operators/pod.py:
##########
@@ -935,6 +935,8 @@ def trigger_reentry(self, context: Context, event: dict[str, Any]) -> Any:
             raise
         finally:
             self._clean(event=event, context=context, result=xcom_sidecar_output)
+            if self.do_xcom_push:
+                return xcom_sidecar_output

Review Comment:
   > Will put this on my bucket list to enable... or if somebody else wants to make a PR I assume this is an important check we are missing atm.
   
   #59019



-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Deferred KubernetesPodOperator pushes XCom on successful execution. [airflow]

Posted by "potiuk (via GitHub)" <gi...@apache.org>.
potiuk commented on code in PR #58488:
URL: https://github.com/apache/airflow/pull/58488#discussion_r2596407394


##########
providers/cncf/kubernetes/src/airflow/providers/cncf/kubernetes/operators/pod.py:
##########
@@ -935,6 +935,8 @@ def trigger_reentry(self, context: Context, event: dict[str, Any]) -> Any:
             raise
         finally:
             self._clean(event=event, context=context, result=xcom_sidecar_output)
+            if self.do_xcom_push:
+                return xcom_sidecar_output

Review Comment:
   Cool. Thanks @johnslavik !



-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Deferred KubernetesPodOperator pushes XCom on successful execution. [airflow]

Posted by "AutomationDev85 (via GitHub)" <gi...@apache.org>.
AutomationDev85 commented on code in PR #58488:
URL: https://github.com/apache/airflow/pull/58488#discussion_r2585062347


##########
providers/cncf/kubernetes/src/airflow/providers/cncf/kubernetes/operators/pod.py:
##########
@@ -935,6 +935,8 @@ def trigger_reentry(self, context: Context, event: dict[str, Any]) -> Any:
             raise
         finally:
             self._clean(event=event, context=context, result=xcom_sidecar_output)
+            if self.do_xcom_push:
+                return xcom_sidecar_output

Review Comment:
   @johnslavik thanks for identifying this issue!! I created a PR to fix this issue: https://github.com/apache/airflow/pull/58998



-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Deferred KubernetesPodOperator pushes XCom on successful execution. [airflow]

Posted by "johnslavik (via GitHub)" <gi...@apache.org>.
johnslavik commented on code in PR #58488:
URL: https://github.com/apache/airflow/pull/58488#discussion_r2575411049


##########
providers/cncf/kubernetes/src/airflow/providers/cncf/kubernetes/operators/pod.py:
##########
@@ -935,6 +935,8 @@ def trigger_reentry(self, context: Context, event: dict[str, Any]) -> Any:
             raise
         finally:
             self._clean(event=event, context=context, result=xcom_sidecar_output)
+            if self.do_xcom_push:
+                return xcom_sidecar_output

Review Comment:
   This could be illegal syntax in a future Python version. We'll need to take that `return` out of `finally`.



##########
providers/cncf/kubernetes/src/airflow/providers/cncf/kubernetes/operators/pod.py:
##########
@@ -935,6 +935,8 @@ def trigger_reentry(self, context: Context, event: dict[str, Any]) -> Any:
             raise
         finally:
             self._clean(event=event, context=context, result=xcom_sidecar_output)
+            if self.do_xcom_push:
+                return xcom_sidecar_output

Review Comment:
   This could be illegal syntax in a future Python version. We'll need to take that `return` out of `finally`.
   https://peps.python.org/pep-0765/



-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org