You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "Reginald A Gomez (JIRA)" <ji...@apache.org> on 2019/05/05 19:23:00 UTC

[jira] [Comment Edited] (AIRFLOW-4089) pytz.utc has no attribute name

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

Reginald A Gomez edited comment on AIRFLOW-4089 at 5/5/19 7:22 PM:
-------------------------------------------------------------------

I'm happy to take this on, but curious about what people think on the best approach. It looks like 

`self.timezone.name` is only used to instantiate pendulum timezone objects.

ex:

 

 
{code:java}
tz = pendulum.timezone(self.timezone.name)
{code}
 

The pytz.zone attribute looks like it would largely work, except in two cases:

 
{code:java}
Africa/Casablanca

Africa/El_Aaiun{code}
The above two cases, though compatible with pytz are incompatible with pendulum.

 

I'm of the opinion that since Airflow is utilizing pendulum tz objects under the hood, we should go with the second option Ricardo proposed - removing pytz from the documentation. If there are other opinions please chime in! I'm new to contributing so very open to other thoughts. 


was (Author: reggieag):
I'm happy to take this on, but curious about what people think on the best approach. It looks like 

`self.timezone.name` is only used to instantiate pendulum timezone objects.

ex:

```

tz = pendulum.timezone(_self_._timezone_._name_)

```

The pytz.zone attribute looks like it would largely work, except in two cases:

```

Africa/Casablanca

Africa/El_Aaiun

```

 

The above two cases, though compatible with pytz are incompatible with pendulum.

 

I'm of the opinion that since Airflow is utilizing pendulum tz objects under the hood, we should go with the second option Ricardo proposed - removing pytz from the documentation. If there are other opinions please chime in! I'm new to contributing so very open to other thoughts. 

> pytz.utc has no attribute name
> ------------------------------
>
>                 Key: AIRFLOW-4089
>                 URL: https://issues.apache.org/jira/browse/AIRFLOW-4089
>             Project: Apache Airflow
>          Issue Type: Bug
>          Components: DAG
>    Affects Versions: 1.10.3
>            Reporter: Ricardo Garcia Silva
>            Priority: Blocker
>
> According to the [docs|https://airflow.readthedocs.io/en/latest/timezone.html#time-zone-aware-dags], even though pendulum is recommended, a DAG's timezone may also be set by using pytz.
> However, if one uses pytz, models.DAG breaks when trying to use 
> {code:python}
> self.timezone.name
> {code}
> pytz timezones do not have a name attribute
> This error is not immediately apparent, but it manifests under certain circumstances, such as preventing the scheduler from creating new DAGRuns for catching up from previous dates if the DAG has a schedule_interval of 
> {code:python}
> 0 0 * * *
> {code}
> This can be fixed by either changing the code not to rely on the existence of a *name* attribute on the timezone object, or changing the existing documentation in order to clearly state that pendulum *must* be used and not pytz or python's timezone 



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)