Daniel Standish created AIRFLOW-4788:
----------------------------------------
Summary: prev_execution_date is not always pendulum.datetime class
Key: AIRFLOW-4788
URL: https://issues.apache.org/jira/browse/AIRFLOW-4788
Project: Apache Airflow
Issue Type: Bug
Components: core
Affects Versions: 1.10.3
Reporter: Daniel Standish
In certain circumstances previous execution dates may not be pendulum type.
For one, when reading from database, UtcDateTime returns native datetime type.
Also dag.previous_schedule returns datetime type.
So, depending on circumstances, `prev_execution_date` and
`ti.previous_ti.execution_date` may be non-pendulum.
The problem is, this leads to errors and confusion when using these fields in
templating, when you expect it to be pendulum but it isn't.
There are a few things to consider:
# make UtcDateTime sqlalchemy type return pendulum
# make execution date a property of TaskInstance with appropriate getter
returning pendulum.
# Change dag.previous_schedule to return pendulum
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)