You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "hussein-awala (via GitHub)" <gi...@apache.org> on 2023/02/09 21:51:01 UTC

[GitHub] [airflow] hussein-awala opened a new pull request, #29451: Fix/render nested fields

hussein-awala opened a new pull request, #29451:
URL: https://github.com/apache/airflow/pull/29451

   closes: #29432
   related: #25588
   
   ---
   **^ Add meaningful description above**
   
   By default, to render nested fields, we need to provide a nested argument `template_fields` contains the list of nested fields names to render. In some of the operator (ex `KubernetesPodOperator`) we override the method `_render_nested_template_fields` to define how we want to render the nested fields.
   
   This works fine with the normal operator because they extend the `BaseOperator`, and since they are not sub classes of `MappedOperator`, when it calls this method we call directly `Templater._render_nested_template_fields` instead of calling the method we overrode.
   
   To solve this problem, I replaced `self._do_render_template_fields` by `unmapped_task._do_render_template_fields` where `unmapped_task` is an instance of the operator where we override the method.


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


[GitHub] [airflow] uranusjr commented on a diff in pull request #29451: Fix nested fields rendering in mapped operators

Posted by "uranusjr (via GitHub)" <gi...@apache.org>.
uranusjr commented on code in PR #29451:
URL: https://github.com/apache/airflow/pull/29451#discussion_r1102278121


##########
airflow/models/mappedoperator.py:
##########
@@ -687,7 +687,7 @@ def render_template_fields(
         unmapped_task = self.unmap(mapped_kwargs)
         context_update_for_unmapped(context, unmapped_task)
 
-        self._do_render_template_fields(
+        unmapped_task._do_render_template_fields(

Review Comment:
   A comment here containing the explaination you gave in the PR description would be a good idea.



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


[GitHub] [airflow] uranusjr merged pull request #29451: Fix nested fields rendering in mapped operators

Posted by "uranusjr (via GitHub)" <gi...@apache.org>.
uranusjr merged PR #29451:
URL: https://github.com/apache/airflow/pull/29451


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