Skip to content

Conversation

@michalsosn
Copy link
Contributor

Closes: #33694

The PR introduces the airflow.template.templater.LiteralValue class, which wraps a single value and makes the Templater immediately return, bypassing Jinja templating for the content.

This class allows you to use strings that include Jinja macros or recognized file extensions as-is, without the need to modify the Operator by altering its template_fields or template_ext.

In cases where a field contains a complex object, it also enables you to selectively disable rendering for a portion of the object. This level of granularity is not achievable by overriding the template_fields.

Additionally, it provides a cleaner approach to avoid rendering files, in contrast to the documented method of leaving a trailing space within the string.


^ Add meaningful description above
Read the Pull Request Guidelines for more information.
In case of fundamental code changes, an Airflow Improvement Proposal (AIP) is needed.
In case of a new dependency, check compliance with the ASF 3rd Party License Policy.
In case of backwards incompatible changes please leave a note in a newsfragment file, named {pr_number}.significant.rst or {issue_number}.significant.rst, in newsfragments.

@Taragolis Taragolis added the type:new-feature Changelog: New Features label Oct 18, 2023
@Taragolis Taragolis added this to the Airflow 2.8.0 milestone Oct 18, 2023
@michalsosn michalsosn requested a review from Taragolis October 18, 2023 14:12
@michalsosn michalsosn force-pushed the 33694-LiteralValue-templater branch 2 times, most recently from 5ab5b11 to ac98c8f Compare October 23, 2023 00:06
@michalsosn michalsosn force-pushed the 33694-LiteralValue-templater branch from ac98c8f to b5b15fc Compare October 24, 2023 20:02
@eladkal eladkal requested a review from uranusjr October 27, 2023 05:14
@michalsosn michalsosn force-pushed the 33694-LiteralValue-templater branch from b5b15fc to 1715198 Compare October 29, 2023 02:13
@michalsosn michalsosn force-pushed the 33694-LiteralValue-templater branch from 1715198 to bfecd90 Compare November 5, 2023 19:42
@potiuk potiuk force-pushed the 33694-LiteralValue-templater branch from bfecd90 to 5da7297 Compare November 6, 2023 00:39
@potiuk potiuk force-pushed the 33694-LiteralValue-templater branch from ce3b014 to 90944f5 Compare November 17, 2023 00:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

airflow jinja template render error

4 participants