|
| 1 | +Purpose: Avoid FTBFS: |
| 2 | + =================================== FAILURES =================================== |
| 3 | + ____________________ TestSeriesIndexing.test_basic_indexing ____________________ |
| 4 | + |
| 5 | + self = <pandas.tests.series.test_indexing.TestSeriesIndexing object at 0x7f01582c04e0> |
| 6 | + |
| 7 | + def test_basic_indexing(self): |
| 8 | + s = Series(np.random.randn(5), index=['a', 'b', 'a', 'a', 'b']) |
| 9 | + |
| 10 | + pytest.raises(IndexError, s.__getitem__, 5) |
| 11 | + pytest.raises(IndexError, s.__setitem__, 5, 0) |
| 12 | + |
| 13 | + pytest.raises(KeyError, s.__getitem__, 'c') |
| 14 | + |
| 15 | + s = s.sort_index() |
| 16 | + |
| 17 | + pytest.raises(IndexError, s.__getitem__, 5) |
| 18 | + > pytest.raises(IndexError, s.__setitem__, 5, 0) |
| 19 | + E Failed: DID NOT RAISE <class 'IndexError'> |
| 20 | + ../debian/tmp/usr/lib/python3/dist-packages/pandas/tests/series/test_indexing.py:1631: Failed |
| 21 | +Reference: |
| 22 | + 1. https://github.com/pandas-dev/pandas/issues/17046 |
| 23 | + 2. https://github.com/pandas-dev/pandas/pull/17724 |
| 24 | +Forward: Not needed. Already fixed in newer releases. |
| 25 | +By: Mo Zhou < [email protected]>, Jan 20 2018 |
| 26 | +Note: Please remove this patch when version >= 0.21. |
| 27 | + |
| 28 | +diff --git a/pandas/core/dtypes/common.py b/pandas/core/dtypes/common.py |
| 29 | +index 2eebf37..f538eaf 100644 |
| 30 | +--- a/pandas/core/dtypes/common.py |
| 31 | ++++ b/pandas/core/dtypes/common.py |
| 32 | +@@ -1155,7 +1155,10 @@ def _is_unorderable_exception(e): |
| 33 | + """ |
| 34 | + |
| 35 | + if PY36: |
| 36 | +- return "'>' not supported between instances of" in str(e) |
| 37 | ++ # Temporary fix for Debian, reference: |
| 38 | ++ # https://github.com/pandas-dev/pandas/pull/17724 |
| 39 | ++ return any("'{}' not supported between instances of".format(op) in |
| 40 | ++ str(e) for op in ('>', '<')) |
| 41 | + |
| 42 | + elif PY3: |
| 43 | + return 'unorderable' in str(e) |
0 commit comments