[ 
https://issues.apache.org/jira/browse/AIRFLOW-4938?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16979371#comment-16979371
 ] 

jack commented on AIRFLOW-4938:
-------------------------------

Was fixed in 1.10.4:

https://issues.apache.org/jira/browse/AIRFLOW-4788

> next_execution_date is not a Pendulum object
> --------------------------------------------
>
>                 Key: AIRFLOW-4938
>                 URL: https://issues.apache.org/jira/browse/AIRFLOW-4938
>             Project: Apache Airflow
>          Issue Type: Bug
>          Components: models
>    Affects Versions: 1.10.2
>         Environment: Airlfow 1.10.2 in Docker using puckel docker image.
> Configured for timezone Copenhagen
>            Reporter: Adam Andersen Læssøe
>            Priority: Major
>
> When templating, it seems `execution_date` refers to a Pendulum object while 
> `next_execution_date` refers to a native `datetime` object.
>  This is inconsistent, and contrary to what the docs say, so I'm thinking 
> it's a bug.
> *Observation*
>  Airflow is configured to run in timezone Copenhagen.
>  I have a where clause like
>  ```
> {code:java}
> WHERE inserted_at >= '{{execution_date}}' AND inserted_at < 
> '{{next_execution_date}}'{code}
> I execute the task using `airflow test ... 2019-07-01`.
>  The clause is rendered as
> {code:java}
> WHERE inserted_at >= '2019-07-01T00:00:00+02:00' AND inserted_at < 
> '2019-07-01 22:00:00+00:00'{code}
>  
> Note how `execution_date` is printed as UTC+2, while `next_execution_date` is 
> printed in UTC. I believe the timestamps actually decribe the correct 
> interval, but to be certain I tried explicitly converting to UTC:
> {code:java}
> WHERE inserted_at >= '{{execution_date.in_tz('UTC')}}' AND inserted_at < 
> '{{next_execution_date.in_tz('UTC')}}'{code}
> I then get an error that datetime.datetime does not have an in_tz method.
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to