Skip to content

Commit 4e3e894

Browse files
committed
Fix more test failure.
Reference: 1. pandas-dev#17724 2. pandas-dev#17046 Gbp-Dch: Short
1 parent 8bdae53 commit 4e3e894

File tree

2 files changed

+44
-0
lines changed

2 files changed

+44
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
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)

debian/patches/series

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ deb_doc_donotoverride_PYTHONPATH
33
deb_skip_stata_on_bigendians
44
deb_disable_googleanalytics
55
deb_skip_sequencelike_on_armel
6+
deb_fix_test_failure_test_basic_indexing
67
# Try to skip -- migth have been addressed upstream
78
# deb_skip_test_pytables_failure
89
# up_buggy_overflows

0 commit comments

Comments
 (0)