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/08/14 04:54:17 UTC

[GitHub] [airflow] uranusjr commented on a diff in pull request #33309: Reuse _run_task_session in mapped render_template_fields

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


##########
airflow/cli/commands/task_command.py:
##########
@@ -634,6 +635,12 @@ def task_test(args, dag: DAG | None = None) -> None:
                 session.delete(ti.dag_run)
 
 
+@provide_session
+def render_template_with_session(ti: TaskInstance, session=NEW_SESSION):
+    with set_current_task_instance_session(session=session):
+        ti.render_templates()

Review Comment:
   Why does this need a separate function?



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