uranusjr commented on code in PR #39259:
URL: https://github.com/apache/airflow/pull/39259#discussion_r1580465386
##########
airflow/models/taskinstance.py:
##########
@@ -3167,6 +3188,8 @@ def render_templates(
# MappedOperator is useless for template rendering, and we need to be
# able to access the unmapped task instead.
original_task.render_template_fields(context, jinja_env)
+ if isinstance(self.task, MappedOperator):
+ self.task = context["ti"].task
Review Comment:
It makes sense, but `if isinstance(self.task, MappedOperator)` is an awkward
condition to check for the case.
> upon receiving a fresh context dict over RPC, we could replace the TIs in
the context with the local TIPydantic object
This sounds somewhat promising. Instead of just the ti, we could probably
try to replace the entire relationship (including e.g. `dag`) so we can get rid
of needing to pass in `dag` separately into `_record_task_map_for_downstreams`.
--
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]