uranusjr commented on code in PR #35017:
URL: https://github.com/apache/airflow/pull/35017#discussion_r1382744257
##########
airflow/template/templater.py:
##########
@@ -155,6 +167,8 @@ def render_template(
return self._render(template, context)
if isinstance(value, ResolveMixin):
return value.resolve(context)
+ if isinstance(value, LiteralValue):
+ return value.value
Review Comment:
Instead of adding a special case, it may be better to make LiteralValue
inherit ResolveMixin and implement `resolve` to just return `value`. This would
avoid surprises if the resolution logic is used elsewhere (can’t think of one
but you never know with a large code base).
##########
airflow/template/templater.py:
##########
@@ -155,6 +167,8 @@ def render_template(
return self._render(template, context)
if isinstance(value, ResolveMixin):
return value.resolve(context)
+ if isinstance(value, LiteralValue):
+ return value.value
Review Comment:
Instead of adding a special case, it may be better to make LiteralValue
inherit ResolveMixin and implement `resolve` to just return `value`. This would
avoid surprises if the resolution logic is used elsewhere (can’t think of one
but you never know with a large code base).
--
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]