Skip to content

ARROW-879: compat with pandas v0.20.0 #585

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions python/pyarrow/compat.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,18 @@

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
Expand Down