uranusjr commented on code in PR #37028:
URL: https://github.com/apache/airflow/pull/37028#discussion_r1625212311
##########
airflow/models/abstractoperator.py:
##########
@@ -730,12 +740,15 @@ def _do_render_template_fields(
pass
try:
- rendered_content = self.render_template(
- value,
- context,
- jinja_env,
- seen_oids,
- )
+ if callable(value):
+ rendered_content = value(render_fn)
Review Comment:
Instead of passing in a callable, it may be better to just make the callable
accept env and context and do whatever it wants with them. It is probably a
good idea to allow the callable to have access to the task context dict in any
case. `seen_oids` should be handled automatically by
`_do_render_template_fields`.
--
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]