-
Notifications
You must be signed in to change notification settings - Fork 13.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Clarify the BaseOperator template_ext
behavior and where it is applied
#1017
Comments
The reason why this happens is because the operator is looking for |
Someone should clarify this in the docs. |
Thanks for the explaination. It seems like not very intuitive behavior for the end user since python scripts use the full path, but shell scripts should use relative paths to the dag file as I understand it? |
Yes, we need to clarify this behavior in the docs. Renaming this issue. |
template_ext
behavior and where it is applied
A quick explanation:
For BashOperator it's more confusing since things like Note that the files are resolved relative to where the pipeline file lives. You can also add other folders to the The magic takes place at some point between the |
Hi,
It seems that when BashOperator is called with a shell script (".sh") instead of a simple command like "date" or a python script like "job.py", airflow is giving a jinja template "not found" error.
It seems like a very weird bug so I was reinstalling airflow and trying it with the tutorial project and I can reproduce the bug there as well.
Even stranger, adding a space as the last character in the shell script makes it work with airflow and run correctly without the error!
To reproduce, change the tutorial project BashOperator t2 to a simple shell script that does something simple, like "echo hello world". Remember to make it executable.
t2 = BashOperator(
task_id='sleep',
bash_command="/home/batcher/test.sh", // This fails with template error
#bash_command="/home/batcher/test.sh ", // This works (has a space after)
dag=dag)
Can someone else reproduce?
The text was updated successfully, but these errors were encountered: