Skip to content

Commit

Permalink
CI: don't show miniconda output on install / numpy 1.14 compat (panda…
Browse files Browse the repository at this point in the history
…s-dev#18157)

CI: don't show miniconda output on install
COMPAT: compat with numpy >= 1.14 on str repr
TST: temp disable python-dateutil from master

closes pandas-dev#18123
  • Loading branch information
jreback authored Nov 8, 2017
1 parent 4054632 commit 8dac633
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 9 deletions.
4 changes: 2 additions & 2 deletions ci/install_travis.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ fi

# install miniconda
if [ "${TRAVIS_OS_NAME}" == "osx" ]; then
time wget http://repo.continuum.io/miniconda/Miniconda3-latest-MacOSX-x86_64.sh -O miniconda.sh || exit 1
time wget http://repo.continuum.io/miniconda/Miniconda3-latest-MacOSX-x86_64.sh -q -O miniconda.sh || exit 1
else
time wget http://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh || exit 1
time wget http://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -q -O miniconda.sh || exit 1
fi
time bash miniconda.sh -b -p "$MINICONDA_DIR" || exit 1

Expand Down
5 changes: 4 additions & 1 deletion ci/requirements-3.6_NUMPY_DEV.build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,10 @@ PRE_WHEELS="https://7933911d6844c6c53a7d-47bd50c35cd79bd838daf386af554a83.ssl.cf
pip install --pre --upgrade --timeout=60 -f $PRE_WHEELS numpy scipy

# install dateutil from master
pip install -U git+git://github.com/dateutil/dateutil.git

# TODO(jreback), temp disable dateutil master has changed
# pip install -U git+git://github.com/dateutil/dateutil.git
pip install python-dateutil

# cython via pip
pip install cython
Expand Down
13 changes: 8 additions & 5 deletions pandas/compat/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -381,17 +381,20 @@ def raise_with_traceback(exc, traceback=Ellipsis):
# http://stackoverflow.com/questions/4126348
# Thanks to @martineau at SO

from dateutil import parser as _date_parser
import dateutil

if PY2 and LooseVersion(dateutil.__version__) == '2.0':
# dateutil brokenness
raise Exception('dateutil 2.0 incompatible with Python 2.x, you must '
'install version 1.5 or 2.1+!')

from dateutil import parser as _date_parser
if LooseVersion(dateutil.__version__) < '2.0':

@functools.wraps(_date_parser.parse)
def parse_date(timestr, *args, **kwargs):
timestr = bytes(timestr)
return _date_parser.parse(timestr, *args, **kwargs)
elif PY2 and LooseVersion(dateutil.__version__) == '2.0':
# dateutil brokenness
raise Exception('dateutil 2.0 incompatible with Python 2.x, you must '
'install version 1.5 or 2.1+!')
else:
parse_date = _date_parser.parse

Expand Down
9 changes: 8 additions & 1 deletion pandas/tests/frame/test_dtypes.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
from pandas import (DataFrame, Series, date_range, Timedelta, Timestamp,
compat, concat, option_context)
from pandas.compat import u
from pandas import _np_version_under1p14

from pandas.core.dtypes.dtypes import DatetimeTZDtype
from pandas.tests.frame.common import TestData
from pandas.util.testing import (assert_series_equal,
Expand Down Expand Up @@ -531,7 +533,12 @@ def test_astype_str(self):
assert_frame_equal(result, expected)

result = DataFrame([1.12345678901234567890]).astype(tt)
expected = DataFrame(['1.12345678901'])
if _np_version_under1p14:
# < 1.14 truncates
expected = DataFrame(['1.12345678901'])
else:
# >= 1.14 preserves the full repr
expected = DataFrame(['1.1234567890123457'])
assert_frame_equal(result, expected)

@pytest.mark.parametrize("dtype_class", [dict, Series])
Expand Down

0 comments on commit 8dac633

Please sign in to comment.