jscheffl commented on code in PR #66596:
URL: https://github.com/apache/airflow/pull/66596#discussion_r3210917768


##########
providers/cncf/kubernetes/src/airflow/providers/cncf/kubernetes/operators/job.py:
##########
@@ -255,7 +255,7 @@ def execute(self, context: Context):
                     f"Kubernetes job '{self.job.metadata.name}' is failed with 
error '{error_message}'"
                 )
             if self.do_xcom_push:
-                return xcom_result
+                return xcom_result[0] if self.unwrap_single and 
len(xcom_result) == 1 else xcom_result

Review Comment:
   Danger! if `xcom_result` is a dict with exactly one entry this will fail. So 
you would need to check type.
   
   Devils advocate: What is the container (by intend) returns a list with one 
entry as XCom? Then you would un-wrap.
   
   I assume the error is generated if multiple containers launch, is there a 
possibility to get the count of containers to prevent such side effects that 
specific content is by accident un-wrapped?



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