Skip to content

Commit

Permalink
Remove unnecessary string concatenations in AirflowException messages (
Browse files Browse the repository at this point in the history
  • Loading branch information
PApostol authored Oct 8, 2021
1 parent e286ee6 commit 42dc076
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions airflow/providers/apache/spark/hooks/spark_submit.py
Original file line number Diff line number Diff line change
Expand Up @@ -386,8 +386,7 @@ def _build_track_driver_status_command(self) -> List[str]:
pass
else:
raise AirflowException(
"Invalid status: attempted to poll driver "
+ "status but no driver id is known. Giving up."
"Invalid status: attempted to poll driver status but no driver id is known. Giving up."
)

else:
Expand All @@ -402,8 +401,7 @@ def _build_track_driver_status_command(self) -> List[str]:
connection_cmd += ["--status", self._driver_id]
else:
raise AirflowException(
"Invalid status: attempted to poll driver "
+ "status but no driver id is known. Giving up."
"Invalid status: attempted to poll driver status but no driver id is known. Giving up."
)

self.log.debug("Poll driver status cmd: %s", connection_cmd)
Expand Down Expand Up @@ -459,7 +457,7 @@ def submit(self, application: str = "", **kwargs: Any) -> None:
if self._should_track_driver_status:
if self._driver_id is None:
raise AirflowException(
"No driver id is known: something went wrong when executing " + "the spark submit command"
"No driver id is known: something went wrong when executing the spark submit command"
)

# We start with the SUBMITTED status as initial status
Expand Down

0 comments on commit 42dc076

Please sign in to comment.