Vamsi-klu commented on PR #68149:
URL: https://github.com/apache/airflow/pull/68149#issuecomment-5463684271
Not on a live instance yet. Coverage so far is
TestLogFilenameTemplateRenderer.
The crash this PR fixes is only the non-Jinja f-string path.
log_filename_template_renderer uses Jinja whenever the template contains "{{".
The default template is Jinja and already does not crash when logical_date is
None. {{ ti.logical_date }} already renders as "None". The original #68075
template (ti.logical_date.strftime / ts_nodash defaulting to strftime) is still
a user template error and still raises UndefinedError. That is intentional and
not what this PR changes.
The AttributeError is ti.logical_date.isoformat() inside f_str_format, from
SchedulerJobRunner._enqueue_task_instances_with_queued_state ->
ExecuteTask.make, for an AIP-83 asset-triggered or partitioned run. After the
guard, {logical_date} becomes the string "None".
Live repro if you want it: set AIRFLOW__LOGGING__LOG_FILENAME_TEMPLATE to a
format string with no "{{", for example
"{dag_id}/{task_id}/{logical_date}/{try_number}.log", restart the scheduler,
and enqueue a run with logical_date NULL. On main the scheduler dies with
AttributeError; on this branch it keeps running. dags test will not hit this
path.
---
Drafted-by: Cursor Grok 4.6; reviewed by @Vamsi-klu before posting
--
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]