You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by as...@apache.org on 2020/10/17 09:25:36 UTC
[airflow] branch master updated: Mention about .sh commands and
templates in BashOperator docs (#11566)
This is an automated email from the ASF dual-hosted git repository.
ash pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/airflow.git
The following commit(s) were added to refs/heads/master by this push:
new bf468c7 Mention about .sh commands and templates in BashOperator docs (#11566)
bf468c7 is described below
commit bf468c7b288820c333dfbd14575a552e011d5a94
Author: Songkran Nethan <so...@kaidee.com>
AuthorDate: Sat Oct 17 16:24:47 2020 +0700
Mention about .sh commands and templates in BashOperator docs (#11566)
---
airflow/operators/bash.py | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/airflow/operators/bash.py b/airflow/operators/bash.py
index 2d55d3f..6b5995b 100644
--- a/airflow/operators/bash.py
+++ b/airflow/operators/bash.py
@@ -62,6 +62,13 @@ class BashOperator(BaseOperator):
bash_command = "set -e; python3 script.py '{{ next_execution_date }}'"
+ .. note::
+
+ Add a space after the script name when directly calling a ``.sh`` script with the
+ ``bash_command`` argument -- for example ``bash_command="my_script.sh "``. This
+ is because Airflow tries to apply load this file and process it as a Jinja template to
+ it ends with ``.sh``, which will likely not be what most users want.
+
.. warning::
Care should be taken with "user" input or when using Jinja templates in the