Skip to content

Commit

Permalink
Add pandas timezone datetime64 type to datetime_types (#2003)
Browse files Browse the repository at this point in the history
  • Loading branch information
philippjfr authored and jlstevens committed Oct 18, 2017
1 parent 932360e commit 0326ee9
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions holoviews/core/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
from collections import defaultdict
from functools import partial
from contextlib import contextmanager
from distutils.version import LooseVersion

from threading import Thread, Event
import numpy as np
Expand All @@ -30,8 +31,12 @@
datetime_types = (np.datetime64, dt.datetime)

try:
import pandas as pd # noqa (optional import)
datetime_types = datetime_types + (pd.Timestamp,)
import pandas as pd
if LooseVersion(pd.__version__) > '0.20.0':
from pandas.core.dtypes.dtypes import DatetimeTZDtypeType
else:
from pandas.types.dtypes import DatetimeTZDtypeType
datetime_types = datetime_types + (pd.Timestamp, DatetimeTZDtypeType)
except ImportError:
pd = None

Expand Down

0 comments on commit 0326ee9

Please sign in to comment.