ashb commented on a change in pull request #21641:
URL: https://github.com/apache/airflow/pull/21641#discussion_r808988190



##########
File path: airflow/models/abstractoperator.py
##########
@@ -249,3 +253,124 @@ def get_extra_links(self, dttm: datetime.datetime, 
link_name: str) -> Optional[D
         elif link_name in self.global_operator_extra_link_dict:
             return 
self.global_operator_extra_link_dict[link_name].get_link(self, dttm)
         return None
+
+    @provide_session
+    def _do_render_template_fields(
+        self,
+        parent: Any,
+        template_fields: Iterable[str],
+        context: Context,
+        jinja_env: "jinja2.Environment",
+        seen_oids: Set,
+        *,
+        session: Session = NEW_SESSION,
+    ) -> None:
+        for attr_name in template_fields:
+            try:
+                content = getattr(parent, attr_name)
+            except AttributeError:
+                raise AttributeError(
+                    f"{attr_name!r} is configured as a template field "
+                    f"but {parent.task_type} does not have this attribute."
+                )
+            if not content:
+                continue
+            rendered_content = self._render_template_field(
+                attr_name,
+                content,
+                context,

Review comment:
       nit: `context` and `content` are very similar, and we'd be somewhat 
error prone to confuse them. Can we rename `content` to something like 
`template`?




-- 
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]


Reply via email to