jens-scheffler-bosch commented on code in PR #32113:
URL: https://github.com/apache/airflow/pull/32113#discussion_r1247026085


##########
airflow/providers/cncf/kubernetes/utils/pod_manager.py:
##########
@@ -562,11 +575,36 @@ def extract_xcom(self, pod: V1Pod) -> str:
                 resp,
                 f"if [ -s {PodDefaults.XCOM_MOUNT_PATH}/return.json ]; then 
cat {PodDefaults.XCOM_MOUNT_PATH}/return.json; else echo 
__airflow_xcom_result_empty__; fi",  # noqa
             )
-            self._exec_pod_command(resp, "kill -s SIGINT 1")
+            if result and result.rstrip() != "__airflow_xcom_result_empty__":
+                json.loads(result)

Review Comment:
   Was a hard time reading this again and needed the context and description of 
the PR to (again) understand the logic. I'd prefer a small comment that 
(somebody in future) taking a look to this line understands that json is just 
loaded for validation - but still the string body is returned and it will be 
converted to a dict in the calling method.
   ```suggestion
                   json.loads(result)  # Note: loading to json just for 
validation of content, not useless code
   ```



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