ephraimbuddy commented on a change in pull request #20482:
URL: https://github.com/apache/airflow/pull/20482#discussion_r774441327
##########
File path: airflow/utils/log/file_task_handler.py
##########
@@ -82,13 +82,15 @@ def _render_filename(self, ti: "TaskInstance", try_number:
int) -> str:
context = Context(ti=ti,
ts=ti.get_dagrun().logical_date.isoformat())
context["try_number"] = try_number
return render_template_to_string(self.filename_jinja_template,
context)
-
- return self.filename_template.format(
- dag_id=ti.dag_id,
- task_id=ti.task_id,
- execution_date=ti.get_dagrun().logical_date.isoformat(),
- try_number=try_number,
- )
+ elif self.filename_template:
+ return self.filename_template.format(
+ dag_id=ti.dag_id,
+ task_id=ti.task_id,
+ execution_date=ti.get_dagrun().logical_date.isoformat(),
+ try_number=try_number,
+ )
+ else:
+ return "" # mypy
Review comment:
This is also another place I'm confused about the best approach to it
and whether to work on the `parse_template_string` itself
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]