stephen-bracken commented on issue #68075:
URL: https://github.com/apache/airflow/issues/68075#issuecomment-4632675975
I figured this out - asset triggered dagruns populate `partition_date`
instead of `logical_date`, therefore they return `None` in the template,
causing an error when `strftime` is called on `logical_date`. To fix this I
updated the template to this:
```
log_filename_template = shared/{{ ti.dag_id }}/{%% if ts_nodash or
ti.logical_date %%}{{ ts_nodash |
default(ti.logical_date.strftime("%%Y%%m%%dT%%H%%M%%S")) }}{%% else %%}{%% if
ti.dag_run.partition_date %%}{{
ti.dag_run.partition_date.strftime("%%Y%%m%%dT%%H%%M%%S") }}{%% else
%%}_scheduler{%% endif %%}{%% endif %%}/{{ ti.task_id }}/{%% if ti.map_index >=
0 %%}index_{{ ti.map_index }}/{%% endif %%}attempt_{{ try_number |
default(ti.try_number) }}.log
```
This is quite a cumbersome workaround, do you think it would be possible to
get some kind of consistent ti run identifier between scheduled runs and asset
based runs?
--
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]