uranusjr commented on code in PR #68149:
URL: https://github.com/apache/airflow/pull/68149#discussion_r3510081231
##########
airflow-core/src/airflow/utils/helpers.py:
##########
@@ -150,14 +150,38 @@ def log_filename_template_renderer() -> Callable[...,
str]:
if "{{" in template:
import jinja2
- return jinja2.Template(template).render
-
- def f_str_format(ti: TaskInstance, try_number: int | None = None):
+ compiled = jinja2.Template(template)
+
+ def render_jinja(ti: TaskInstance, try_number: int | None = None) ->
str:
+ # ``logical_date`` is nullable since AIP-83 (asset-triggered /
partitioned runs).
+ # Mirror ``FileTaskHandler._render_filename`` so the path the
worker writes to and the
+ # path the UI reads from resolve identically. ``ti`` is passed
unchanged, so a plain
+ # ``{{ ti.logical_date }}`` still renders to ``"None"`` rather
than crashing.
+ date = ti.logical_date or ti.run_after
Review Comment:
We discussed this, the fallback should not happen. These are different
values. We are not adding `ts`.
--
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]