potiuk commented on code in PR #53929:
URL: https://github.com/apache/airflow/pull/53929#discussion_r2247696250
##########
airflow-core/src/airflow/utils/helpers.py:
##########
@@ -244,11 +244,6 @@ def render_template_to_string(template: jinja2.Template,
context: Context) -> st
return render_template(template, cast("MutableMapping[str, Any]",
context), native=False)
-def render_template_as_native(template: jinja2.Template, context: Context) ->
Any:
- """Shorthand to ``render_template(native=True)`` with better typing
support."""
- return render_template(template, cast("MutableMapping[str, Any]",
context), native=True)
Review Comment:
I think it's worth doing so. I believe I saw at least few cases where users
used it outside of regular airflow template rendering happening automatically -
because it is so convenient to use in - for example - your `@python` decorated
task. I think especially for people who transition and switch between "classic"
and "taskflow" operators, using JINJA for a number of those transformations is
very natural and straightforward - they can even copy or import the same JINJA
templates to be used in both - classic operators and decorated operators, so
that might even be a good "final" solution.
And rendering as native objects is actually quite cool feature.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]