Skip to content

Commit f3181af

Browse files
committed
Cherry-pick upstream commit to fix test failure caused by test_argsort()
Reference: 1. pandas-dev#17010 2. pandas-dev#17046 3. pandas-dev#17051 4. pandas-dev@df6934c 5. pandas-dev@480d574 Gbp-Dch: Short
1 parent 48a39a8 commit f3181af

File tree

3 files changed

+72
-0
lines changed

3 files changed

+72
-0
lines changed

debian/patches/series

+2
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ deb_skip_sequencelike_on_armel
1010
up_print_versions
1111
up_network_seaborn
1212
up_tst_dont_assert_that_a_bug_exists_in_numpy
13+
up_tst_np_argsort_comparison1
14+
up_tst_np_argsort_comparison2
1315
dateutil-2.6.1-fixed-ambiguous-tz-dst-be.patch
1416
mark_tests_working_on_intel.patch
1517
mark_tests_working_on_intel_s390x.patch
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
From df6934cad28c33c3eaf584ad3519cc1b9b8e16f4 Mon Sep 17 00:00:00 2001
2+
From: ysau <[email protected]>
3+
Date: Fri, 21 Jul 2017 21:21:38 -0700
4+
Subject: [PATCH] # modified: /doc/source/whatsnew/v0.21.0.txt # # undone
5+
update to release note
6+
7+
---
8+
doc/source/whatsnew/v0.21.0.txt | 1 -
9+
1 file changed, 1 deletion(-)
10+
11+
diff --git a/doc/source/whatsnew/v0.21.0.txt b/doc/source/whatsnew/v0.21.0.txt
12+
index e4c50ec93f9..91d3e9e7b93 100644
13+
--- a/doc/source/whatsnew/v0.21.0.txt
14+
+++ b/doc/source/whatsnew/v0.21.0.txt
15+
@@ -259,7 +259,6 @@ Indexing
16+
- Fixes bug where indexing with ``np.inf`` caused an ``OverflowError`` to be raised (:issue:`16957`)
17+
- Bug in reindexing on an empty ``CategoricalIndex`` (:issue:`16770`)
18+
- Fixes ``DataFrame.loc`` for setting with alignment and tz-aware ``DatetimeIndex`` (:issue:`16889`)
19+
-- Fixes ``test_argsort``, ``test_numpy_argsort`` to cover both `>` and `<` in the error message (:issue:`17046`)
20+
21+
I/O
22+
^^^
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
From 480d5745e1443de6e91a9f9c42d94e29705a3f43 Mon Sep 17 00:00:00 2001
2+
From: ysau <[email protected]>
3+
Date: Fri, 21 Jul 2017 16:29:12 -0700
4+
Subject: [PATCH] # Issue 17046 # # modified:
5+
/pandas/tests/indexes/test_base.py, #
6+
/doc/source/whatsnew/v0.21.0.txt # # Include both '>' and '<' in the error
7+
message in # TestMixedIntIndex.test_argsort and #
8+
TestMixedIntIndex.test_numpy_argsort
9+
10+
---
11+
doc/source/whatsnew/v0.21.0.txt | 1 +
12+
pandas/tests/indexes/test_base.py | 4 ++--
13+
2 files changed, 3 insertions(+), 2 deletions(-)
14+
15+
diff --git a/doc/source/whatsnew/v0.21.0.txt b/doc/source/whatsnew/v0.21.0.txt
16+
index 91d3e9e7b93..e4c50ec93f9 100644
17+
--- a/doc/source/whatsnew/v0.21.0.txt
18+
+++ b/doc/source/whatsnew/v0.21.0.txt
19+
@@ -259,6 +259,7 @@ Indexing
20+
- Fixes bug where indexing with ``np.inf`` caused an ``OverflowError`` to be raised (:issue:`16957`)
21+
- Bug in reindexing on an empty ``CategoricalIndex`` (:issue:`16770`)
22+
- Fixes ``DataFrame.loc`` for setting with alignment and tz-aware ``DatetimeIndex`` (:issue:`16889`)
23+
+- Fixes ``test_argsort``, ``test_numpy_argsort`` to cover both `>` and `<` in the error message (:issue:`17046`)
24+
25+
I/O
26+
^^^
27+
diff --git a/pandas/tests/indexes/test_base.py b/pandas/tests/indexes/test_base.py
28+
index 692cdd49579..842e8fea0df 100644
29+
--- a/pandas/tests/indexes/test_base.py
30+
+++ b/pandas/tests/indexes/test_base.py
31+
@@ -1846,7 +1846,7 @@ def create_index(self):
32+
def test_argsort(self):
33+
idx = self.create_index()
34+
if PY36:
35+
- with tm.assert_raises_regex(TypeError, "'>' not supported"):
36+
+ with tm.assert_raises_regex(TypeError, "'>|<' not supported"):
37+
result = idx.argsort()
38+
elif PY3:
39+
with tm.assert_raises_regex(TypeError, "unorderable types"):
40+
@@ -1859,7 +1859,7 @@ def test_argsort(self):
41+
def test_numpy_argsort(self):
42+
idx = self.create_index()
43+
if PY36:
44+
- with tm.assert_raises_regex(TypeError, "'>' not supported"):
45+
+ with tm.assert_raises_regex(TypeError, "'>|<' not supported"):
46+
result = np.argsort(idx)
47+
elif PY3:
48+
with tm.assert_raises_regex(TypeError, "unorderable types"):

0 commit comments

Comments
 (0)