You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2018/10/31 11:49:57 UTC

[GitHub] ashb commented on a change in pull request #4075: [AIRFLOW-502] BashOperator success/failure conditions not documented

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

 ##########
 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:
   If you can test, I think that having `set -e` at the start would mean that `exit(1)` is not needed.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services