yuqian90 commented on a change in pull request #11335:
URL: https://github.com/apache/airflow/pull/11335#discussion_r562450598
##########
File path: airflow/models/taskinstance.py
##########
@@ -1576,28 +1574,22 @@ def get(
}
def get_rendered_template_fields(self):
- """
- Fetch rendered template fields from DB if Serialization is enabled.
- Else just render the templates
- """
+ """Fetch rendered template fields from DB"""
from airflow.models.renderedtifields import RenderedTaskInstanceFields
- if STORE_SERIALIZED_DAGS:
- rendered_task_instance_fields =
RenderedTaskInstanceFields.get_templated_fields(self)
- if rendered_task_instance_fields:
- for field_name, rendered_value in
rendered_task_instance_fields.items():
- setattr(self.task, field_name, rendered_value)
- else:
- try:
- self.render_templates()
- except (TemplateAssertionError, UndefinedError) as e:
- raise AirflowException(
- "Webserver does not have access to User-defined Macros
or Filters "
- "when Dag Serialization is enabled. Hence for the task
that have not yet "
- "started running, please use 'airflow tasks render'
for debugging the "
- "rendering of template_fields."
- ) from e
+ rendered_task_instance_fields =
RenderedTaskInstanceFields.get_templated_fields(self)
+ if rendered_task_instance_fields:
+ for field_name, rendered_value in
rendered_task_instance_fields.items():
+ setattr(self.task, field_name, rendered_value)
else:
- self.render_templates()
+ try:
+ self.render_templates()
+ except (TemplateAssertionError, UndefinedError) as e:
+ raise AirflowException(
+ "Webserver does not have access to User-defined Macros or
Filters "
Review comment:
Hi, @kaxil . Thanks for pointing out that the "Rendered Template" error
is handled with an error message. Then that issue is a small annoyance for the
user because they cannot see the rendered arguments in the website.
However, the `ExternalTaskMarker` actually causes issue in the Webserver
when user hits Clear. I opened an issue here
https://github.com/apache/airflow/issues/13827
I don't mind working on a fix. Just wondering if you have any suggestions
how to do it.
----------------------------------------------------------------
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]