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


##########
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:
   For this if I only included the attributes from `BaseOperator` then some 
attributes get leaked through from the `MappedOperator`. This is the result of 
test when not removing additional attributes from `MappedOperator`.
   
   ```{'weight_rule', 'arg3', 'queue', 'trigger_rule', 'owner', 'arg1', 'arg2', 
'task_id'}```
   
   With both all the attributes belonging to the parent classes are excluded.
   
   ```{'arg1', 'arg2', 'arg3'}```



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