stijndehaes commented on a change in pull request #8730:
URL: https://github.com/apache/airflow/pull/8730#discussion_r458532937



##########
File path: airflow/providers/apache/spark/hooks/spark_submit.py
##########
@@ -421,11 +421,18 @@ def submit(self, application="", **kwargs):
         # Check spark-submit return code. In Kubernetes mode, also check the 
value
         # of exit code in the log, as it may differ.
         if returncode or (self._is_kubernetes and self._spark_exit_code != 0):
-            raise AirflowException(
-                "Cannot execute: {}. Error code is: {}.".format(
-                    self._mask_cmd(spark_submit_cmd), returncode
+            if self._is_kubernetes:
+                raise AirflowException(
+                    "Cannot execute: {}. Error code is: {}.".format(
+                        self._mask_cmd(spark_submit_cmd), returncode
+                    )
+                )
+            else:
+                raise AirflowException(
+                    "Cannot execute: {}. Error code is: {}. Kubernetes spark 
exit code is: {}".format(

Review comment:
       Thanks for catching that will update the PR




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

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to