galak75 commented on a change in pull request #4743: [AIRFLOW-3871] render 
Operators template fields recursively
URL: https://github.com/apache/airflow/pull/4743#discussion_r293497903
 
 

 ##########
 File path: airflow/models/baseoperator.py
 ##########
 @@ -644,9 +648,23 @@ def render_template_from_field(self, attr, content, 
context, jinja_env):
                 k: rt("{}[{}]".format(attr, k), v, context)
                 for k, v in list(content.items())}
         else:
-            result = content
+            result = self._render_nested_template_fields(content, context)
         return result
 
+    def _render_nested_template_fields(self, content, context):
 
 Review comment:
   Hi @ashb,
   
   I might be wrong, but I think there is one change missing in your diff: 
`render_template` signature has to be changed:
   
   ```diff
               for field in nested_template_fields:
                   rendered = self.render_template(field, getattr(content, 
field), context, seen_oids=seen_oids)
                   setattr(content, field, rendered)
           return content
   
   -     def render_template(self, attr, content, context):
   +     def render_template(self, attr, content, context, seen_oids):
            """
            Renders a template either from a file or directly in a field, and 
returns
   ```
   
   And this is precisily the change I'm not sure it 's appropriate. What do you 
think ?
   

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to