next_ds 在时区感知 DAG 中跨夏令时的行为是否正确?

Does next_ds behave correctly across daylight savings in timezone aware DAG?

我正在 运行 设置时区感知 DAG (tz=Europe/London),时间表为 0 0 * * 1-5

在星期五的 运行 中,2020-03-27next_ds 设置为 2020-03-29。但是,按照时间表,我预计它会是 2020-03-30

间隔包含夏令时跳过 - next_ds 是否可能没有正确考虑到这一点?还是对此行为有不同的解释?

原来我应该阅读手册 - https://airflow.apache.org/docs/stable/timezone.html 上面写着

Airflow returns time zone aware datetimes in templates, but does not convert them to local time so they remain in UTC. It is left up to the DAG to handle this.

我现在正在使用 jinja 过滤器解决这个问题,定义

def local_ds(execution_date):
    return execution_date.in_timezone(local_tz).strftime('%Y-%m-%d')

然后在模板中使用 {{ execution_date | local_ds }}

我想这对使用 Europe/London 时区工作的人来说尤其不利,因为当地时间的午夜在冬季是 UTC 的午夜,但在夏季它变成了前一天的 23:00 UTC , 因此更改日期。