Skip to content

Commit

Permalink
Fix AirflowSkipException message raised by BashOperator
Browse files Browse the repository at this point in the history
  • Loading branch information
dolfinus committed Dec 21, 2023
1 parent 0b32613 commit 7006587
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions airflow/operators/bash.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ def __init__(
skip_on_exit_code
if isinstance(skip_on_exit_code, Container)
else [skip_on_exit_code]
if skip_on_exit_code
if skip_on_exit_code is not None
else []
)
self.cwd = cwd
Expand Down Expand Up @@ -235,8 +235,8 @@ def execute(self, context: Context):
output_encoding=self.output_encoding,
cwd=self.cwd,
)
if self.skip_on_exit_code is not None and result.exit_code in self.skip_on_exit_code:
raise AirflowSkipException(f"Bash command returned exit code {self.skip_on_exit_code}. Skipping.")
if result.exit_code in self.skip_on_exit_code:
raise AirflowSkipException(f"Bash command returned exit code {result.exit_code}. Skipping.")
elif result.exit_code != 0:
raise AirflowException(
f"Bash command failed. The command returned a non-zero exit code {result.exit_code}."
Expand Down

0 comments on commit 7006587

Please sign in to comment.