You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "uranusjr (via GitHub)" <gi...@apache.org> on 2023/02/03 04:39:13 UTC

[GitHub] [airflow] uranusjr commented on a diff in pull request #29034: Add functionality for operators to template all eligible fields (apac…

uranusjr commented on code in PR #29034:
URL: https://github.com/apache/airflow/pull/29034#discussion_r1095347948


##########
airflow/models/baseoperator.py:
##########
@@ -1184,7 +1199,23 @@ def render_template_fields(
         """
         if not jinja_env:
             jinja_env = self.get_template_env()
-        self._do_render_template_fields(self, self.template_fields, context, jinja_env, set())
+
+        if self.template_all_fields:
+            template_fields = (
+                {key for key in self.__dict__.keys() if isinstance(getattr(self, key), str)}
+                - set(BaseOperator.__dict__.keys())
+                - set(MappedOperator.__dict__.keys())
+            )

Review Comment:
   Does not looks right MappedOperator is relevant here, it breaks the OOP principles.



-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org