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 2022/03/01 22:22:50 UTC

[GitHub] [airflow] SamWheating commented on issue #21918: TemplateNotFound error when trying to run the 'touch' command in the BashOperator

SamWheating commented on issue #21918:
URL: https://github.com/apache/airflow/issues/21918#issuecomment-1055918128


   This is because anything in the `bash_command` argument ending with `.sh` or `.bash` is treated as a file to be loaded and rendered as a template:
   
   https://github.com/apache/airflow/blob/602abe8394fafe7de54df7e73af56de848cdf617/airflow/operators/bash.py#L127-L130
   
   Some more info in here:
   https://airflow.apache.org/docs/apache-airflow/stable/howto/custom-operator.html#templating
   
   As a quick workaround could you just change it to something which is functionally the same but doesn't end in `.sh`? for example:
   
   - `bash_command="touch 'template_searchpath.sh'",`
   - `bash_command="touch template_searchpath.sh && echo done",`
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org