Skip to content

COMPAT: xarray 0.8.2 test compat w.r.t. CategoricalIndex idempotency #15285

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

Merged
merged 1 commit into from
Feb 1, 2017
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion ci/install_travis.sh
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ else
echo "[pip installs]"
REQ="ci/requirements-${PYTHON_VERSION}${JOB_TAG}.pip"
if [ -e ${REQ} ]; then
pip install --upgrade -r $REQ
pip install -r $REQ
fi

# may have addtl installation instructions for this build
Expand Down
2 changes: 1 addition & 1 deletion ci/requirements-2.7.run
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@ html5lib=1.0b2
beautiful-soup=4.2.1
statsmodels
jinja2=2.8
xarray
xarray=0.8.0
1 change: 1 addition & 0 deletions ci/requirements-3.5.pip
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
xarray==0.9.1
1 change: 0 additions & 1 deletion ci/requirements-3.5.run
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,5 @@ bottleneck
sqlalchemy
pymysql
psycopg2
xarray
s3fs
beautifulsoup4
19 changes: 11 additions & 8 deletions pandas/tests/test_generic.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
from numpy import nan
import pandas as pd

from distutils.version import LooseVersion
from pandas.types.common import is_scalar
from pandas import (Index, Series, DataFrame, Panel, isnull,
date_range, period_range, Panel4D)
Expand Down Expand Up @@ -870,6 +871,7 @@ def test_describe_none(self):
def test_to_xarray(self):

tm._skip_if_no_xarray()
import xarray
from xarray import DataArray

s = Series([])
Expand All @@ -895,15 +897,16 @@ def testit(index, check_index_type=True, check_categorical=True):
check_index_type=check_index_type,
check_categorical=check_categorical)

for index in [tm.makeFloatIndex, tm.makeIntIndex,
tm.makeStringIndex, tm.makeUnicodeIndex,
tm.makeDateIndex, tm.makePeriodIndex,
tm.makeTimedeltaIndex]:
testit(index)
l = [tm.makeFloatIndex, tm.makeIntIndex,
tm.makeStringIndex, tm.makeUnicodeIndex,
tm.makeDateIndex, tm.makePeriodIndex,
tm.makeTimedeltaIndex]

if LooseVersion(xarray.__version__) >= '0.8.0':
l.append(tm.makeCategoricalIndex)

# not idempotent
testit(tm.makeCategoricalIndex, check_index_type=False,
check_categorical=False)
for index in l:
testit(index)

s = Series(range(6))
s.index.name = 'foo'
Expand Down