Skip to content

Commit b2c5ca5

Browse files
committed
CI: don't show miniconda output on install
COMPAT: compat with numpy >= 1.14 on str repr closes #18123
1 parent 488db6f commit b2c5ca5

File tree

3 files changed

+18
-8
lines changed

3 files changed

+18
-8
lines changed

ci/install_travis.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,9 @@ fi
3434

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

pandas/compat/__init__.py

+8-5
Original file line numberDiff line numberDiff line change
@@ -381,17 +381,20 @@ def raise_with_traceback(exc, traceback=Ellipsis):
381381
# http://stackoverflow.com/questions/4126348
382382
# Thanks to @martineau at SO
383383

384-
from dateutil import parser as _date_parser
385384
import dateutil
385+
386+
if PY2 and LooseVersion(dateutil.__version__) == '2.0':
387+
# dateutil brokenness
388+
raise Exception('dateutil 2.0 incompatible with Python 2.x, you must '
389+
'install version 1.5 or 2.1+!')
390+
391+
from dateutil import parser as _date_parser
386392
if LooseVersion(dateutil.__version__) < '2.0':
393+
387394
@functools.wraps(_date_parser.parse)
388395
def parse_date(timestr, *args, **kwargs):
389396
timestr = bytes(timestr)
390397
return _date_parser.parse(timestr, *args, **kwargs)
391-
elif PY2 and LooseVersion(dateutil.__version__) == '2.0':
392-
# dateutil brokenness
393-
raise Exception('dateutil 2.0 incompatible with Python 2.x, you must '
394-
'install version 1.5 or 2.1+!')
395398
else:
396399
parse_date = _date_parser.parse
397400

pandas/tests/frame/test_dtypes.py

+8-1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
from pandas import (DataFrame, Series, date_range, Timedelta, Timestamp,
1111
compat, concat, option_context)
1212
from pandas.compat import u
13+
from pandas import _np_version_under1p14
14+
1315
from pandas.core.dtypes.dtypes import DatetimeTZDtype
1416
from pandas.tests.frame.common import TestData
1517
from pandas.util.testing import (assert_series_equal,
@@ -531,7 +533,12 @@ def test_astype_str(self):
531533
assert_frame_equal(result, expected)
532534

533535
result = DataFrame([1.12345678901234567890]).astype(tt)
534-
expected = DataFrame(['1.12345678901'])
536+
if _np_version_under1p14:
537+
# < 1.14 truncates
538+
expected = DataFrame(['1.12345678901'])
539+
else:
540+
# >= 1.14 preserves the full repr
541+
expected = DataFrame(['1.12345678901234567'])
535542
assert_frame_equal(result, expected)
536543

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

0 commit comments

Comments
 (0)