arrow-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From w...@apache.org
Subject arrow git commit: ARROW-879: compat with pandas v0.20.0
Date Sun, 23 Apr 2017 22:37:05 GMT
Repository: arrow
Updated Branches:
  refs/heads/master a0a925b42 -> 26e5bb162


ARROW-879: compat with pandas v0.20.0

Author: Jeff Reback <jeff.reback@twosigma.com>

Closes #585 from jreback/compat and squashes the following commits:

1f1f4ed [Jeff Reback] use permanent pandas.api.types import
28c6608 [Jeff Reback] compat with pandas v0.20.0


Project: http://git-wip-us.apache.org/repos/asf/arrow/repo
Commit: http://git-wip-us.apache.org/repos/asf/arrow/commit/26e5bb16
Tree: http://git-wip-us.apache.org/repos/asf/arrow/tree/26e5bb16
Diff: http://git-wip-us.apache.org/repos/asf/arrow/diff/26e5bb16

Branch: refs/heads/master
Commit: 26e5bb1627f3b9768afccf018946720a688cf6f6
Parents: a0a925b
Author: Jeff Reback <jeff.reback@twosigma.com>
Authored: Sun Apr 23 18:37:00 2017 -0400
Committer: Wes McKinney <wes.mckinney@twosigma.com>
Committed: Sun Apr 23 18:37:00 2017 -0400

----------------------------------------------------------------------
 python/pyarrow/compat.py | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/arrow/blob/26e5bb16/python/pyarrow/compat.py
----------------------------------------------------------------------
diff --git a/python/pyarrow/compat.py b/python/pyarrow/compat.py
index 4dcc116..8d15c4c 100644
--- a/python/pyarrow/compat.py
+++ b/python/pyarrow/compat.py
@@ -32,9 +32,18 @@ PY2 = sys.version_info[0] == 2
 
 try:
     import pandas as pd
-    if LooseVersion(pd.__version__) < '0.19.0':
-        pdapi = pd.core.common
+    pdver = LooseVersion(pd.__version__)
+    if pdver >= '0.20.0':
+        try:
+            from pandas.api.types import DatetimeTZDtype
+        except AttributeError:
+            # can be removed once 0.20.0 is released
+            from pandas.core.dtypes.dtypes import DatetimeTZDtype
+
+        pdapi = pd.api.types
+    elif pdver < '0.19.0':
         from pandas.core.dtypes import DatetimeTZDtype
+        pdapi = pd.core.common
     else:
         from pandas.types.dtypes import DatetimeTZDtype
         pdapi = pd.api.types


Mime
View raw message