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-956: [Python] compat with pandas >= 0.20.0
Date Sat, 06 May 2017 19:40:49 GMT
Repository: arrow
Updated Branches:
  refs/heads/master c3a122e1c -> 75ebf5ca8


ARROW-956: [Python] compat with pandas >= 0.20.0

ARROW-944: [Python] compat with pandas < 0.19.0

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

Closes #649 from jreback/pandas_compat2 and squashes the following commits:

91fd9fb [Jeff Reback] ARROW-956: [Python] compat with pandas >= 0.20.0
025639c [Jeff Reback] ARROW-944: [Python] compat with pandas < 0.19.0


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

Branch: refs/heads/master
Commit: 75ebf5ca809ee648a3f64aa9b967246167c509f1
Parents: c3a122e
Author: Jeff Reback <jeff.reback@twosigma.com>
Authored: Sat May 6 15:40:43 2017 -0400
Committer: Wes McKinney <wes.mckinney@twosigma.com>
Committed: Sat May 6 15:40:43 2017 -0400

----------------------------------------------------------------------
 python/pyarrow/compat.py | 15 +++++----------
 1 file changed, 5 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/arrow/blob/75ebf5ca/python/pyarrow/compat.py
----------------------------------------------------------------------
diff --git a/python/pyarrow/compat.py b/python/pyarrow/compat.py
index 928a2c0..7be35df 100644
--- a/python/pyarrow/compat.py
+++ b/python/pyarrow/compat.py
@@ -34,19 +34,14 @@ try:
     import pandas as pd
     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
-
+        from pandas.api.types import DatetimeTZDtype
         pdapi = pd.api.types
-    elif pdver < '0.19.0':
-        from pandas.core.dtypes import DatetimeTZDtype
-        pdapi = pd.core.common
-    else:
+    elif pdver >= '0.19.0':
         from pandas.types.dtypes import DatetimeTZDtype
         pdapi = pd.api.types
+    else:
+        from pandas.types.dtypes import DatetimeTZDtype
+        pdapi = pd.core.common
 
     PandasSeries = pd.Series
     Categorical = pd.Categorical


Mime
View raw message