Skip to content

Tutorial docs: fix bash_command example to avoid Jinja template not found#14066

Closed
eladkal wants to merge 1 commit intoapache:masterfrom
eladkal:8999
Closed

Tutorial docs: fix bash_command example to avoid Jinja template not found#14066
eladkal wants to merge 1 commit intoapache:masterfrom
eladkal:8999

Conversation

@eladkal
Copy link
Copy Markdown
Contributor

@eladkal eladkal commented Feb 4, 2021

closes: #8999

The tutorial explains how to use Jinja templating with BashOperator.
Executing the command as in the tutorial will raise Jinja template not found error.
The reason for this explained at length in the troubleshooting section of BashOperator.

I chose not to add explanation why the space is needed because this is a tutorial to templating with Jinja and not to BashOperator. Users who go over it might not use bash again so there is no need to trouble them with why this space is required.

Copy link
Copy Markdown
Member

@kaxil kaxil left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is incorrect. As explained in the docs itself if the file is relative to jinja searchpath it works out of the box and does not require any space.

Check the description:

https://github.com/apache/airflow/blob/568327f01a39d6f181dda62ef6a143f5096e6b97/airflow/models/dag.py#L142:L146

The tutorial clearly mentions that file path is relative to dag

@eladkal
Copy link
Copy Markdown
Contributor Author

eladkal commented Feb 4, 2021

double checked. You are correct.
closing

@eladkal eladkal closed this Feb 4, 2021
@eladkal eladkal deleted the 8999 branch February 4, 2021 23:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Tutorial documentation with bash_command correction

2 participants