Consider supporting .jinja2 extensions across the project
See original GitHub issueDescription
At the moment, various operators support reading templates from given filenames (for example, bash_command of BashOperator
). However, all of these operators specify extensions such as .sh
, .json
etc., so it means users need to write Jinja2 templates inside .sh
, .json
files. A better way to do it would be supporting the .jinja2
extension.
Use case / motivation
The motivation is threefold:
.jinja2
extension is a widespread convention which is supported by various editors, including Github itself, PyCharm and VSCode.- Putting templates inside
.jinja2
can help distinguish between regular files and template files just by looking at the directory contents - Working with tools that recognize
.jinja2
templates can help reduce errors while authoring templates.
Related Issues
https://github.com/apache/airflow/pull/8572#discussion_r416473395
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:7 (6 by maintainers)
Top Results From Across the Web
Consider supporting .jinja2 extensions across the project ... - Re
Re: Consider supporting .jinja2 extensions across the project ... I built the code so it can easily accommodate other Jinja extensions if needed....
Read more >Extensions — Jinja Documentation (3.0.x)
Jinja supports extensions that can add extra filters, tests, globals or even extend the parser. The main motivation of extensions is to move...
Read more >Jinja extensions (like Django template library tags)
How to use and create Jinja extensions in Django projects. ... This is all that's necessary to enable a Jinja extension across all...
Read more >Visual Studio Code and Jinja templates - Stack Overflow
This helps if you just want to limit the use of Unibeautify to just Jinja files on a project by project basis. I...
Read more >Jinja2 Template Extensions - YouTube
How to use base templates and template extensions in Jinja2 This educational video was created for use in LaunchCode's in-person training ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
No, actually this is a bit different i.e. the OP wants to allow using “file.jinja2” instead of “file.bash” or “file.sql” in rendered template fields.
@kaxil this issue should be resolved by https://github.com/apache/airflow/pull/14603 correct?