ron819 commented on a change in pull request #4075: [AIRFLOW-502] BashOperator
success/failure conditions not documented
URL: https://github.com/apache/incubator-airflow/pull/4075#discussion_r227330074
##########
File path: airflow/operators/bash_operator.py
##########
@@ -49,6 +49,16 @@ class BashOperator(BaseOperator):
:type env: dict
:param output_encoding: Output encoding of bash command
:type output_encoding: str
+
+ On execution of the operator the task will up for retry when exception is
raised.
+ However if a command exists with non-zero value Airflow will not recognize
+ it as failure unless explicitly specified in the beggining of the script.
+ Example: bash_command = python3 script.py '{{ next_execution_date }}'
+ when executing command exit(1) the task will be marked as success.
Review comment:
For some reason my comment disappeared?
This PR only document kakil answer on stackoverflow.
I did not have further commands on my script. It executed a exit(1) -
Airflow considered it to be a successful run. Only after applying kakil's
answer airflow considered this to be failure and set the task on up for retry
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services