ashb commented on code in PR #22975:
URL: https://github.com/apache/airflow/pull/22975#discussion_r849659308
##########
airflow/models/mappedoperator.py:
##########
@@ -686,33 +693,40 @@ def render_template_fields(
"""
if not jinja_env:
jinja_env = self.get_template_env()
- unmapped_task = self.unmap()
+ # Before we unmap we have to resolve the mapped arguments, otherwise
the real operator constructor
+ # could be called with an XComArg, rather than the value it resolves
to.
+ #
+ # We also need to resolve _all_ mapped arguments, even if they aren't
marked as templated
+ kwargs = self._get_unmap_kwargs()
+
+ template_fields = set(self.template_fields)
+
+ self._resolve_expansion_kwargs(kwargs, template_fields, context,
session)
+
+ unmapped_task = self.unmap(rendered_kwargs=kwargs)
self._do_render_template_fields(
parent=unmapped_task,
- template_fields=unmapped_task.template_fields,
+ template_fields=template_fields,
context=context,
jinja_env=jinja_env,
seen_oids=set(),
)
return unmapped_task
- def _render_template_field(
Review Comment:
Do you mean
https://github.com/apache/airflow/pull/22975/files#diff-f373d874912ccfa03918e853ad15aa91d6bfaa1ee75f1676f78c8a756f332ed0L355
--
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]