You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2022/04/06 20:44:21 UTC

[GitHub] [airflow] jedcunningham commented on a diff in pull request #22770: Fix `email_on_failure` with `render_template_as_native_obj`

jedcunningham commented on code in PR #22770:
URL: https://github.com/apache/airflow/pull/22770#discussion_r844406827


##########
airflow/models/taskinstance.py:
##########
@@ -2196,7 +2196,7 @@ def get_email_subject_content(self, exception: BaseException) -> Tuple[str, str,
             html_content_err = jinja_env.from_string(default_html_content_err).render(**default_context)
 
         else:
-            jinja_env = self.task.get_template_env()
+            jinja_env = self.task.get_template_env(force_sandboxed=True)

Review Comment:
   I think I lean toward this being "internal" to the task, but I'm not sure how others view it.
   
   We could inspect, but emails would still fail even then. I wonder if we should instead release a new psrp provider that has a minimum core of 2.3.0. I guess the most 'flexible', ignoring the email issue, is to inspect in both so new providers still work on old core and vice versa.



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