Skip to content

Commit

Permalink
Cherry-pick upstream commit to fix test failure caused by test_argsort()
Browse files Browse the repository at this point in the history
  • Loading branch information
cdluminate committed Jan 21, 2018
1 parent 48a39a8 commit f3181af
Show file tree
Hide file tree
Showing 3 changed files with 72 additions and 0 deletions.
2 changes: 2 additions & 0 deletions debian/patches/series
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ deb_skip_sequencelike_on_armel
up_print_versions
up_network_seaborn
up_tst_dont_assert_that_a_bug_exists_in_numpy
up_tst_np_argsort_comparison1
up_tst_np_argsort_comparison2
dateutil-2.6.1-fixed-ambiguous-tz-dst-be.patch
mark_tests_working_on_intel.patch
mark_tests_working_on_intel_s390x.patch
Expand Down
22 changes: 22 additions & 0 deletions debian/patches/up_tst_np_argsort_comparison1
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
From df6934cad28c33c3eaf584ad3519cc1b9b8e16f4 Mon Sep 17 00:00:00 2001
From: ysau <yatshan.au@gmail.com>
Date: Fri, 21 Jul 2017 21:21:38 -0700
Subject: [PATCH] # modified: /doc/source/whatsnew/v0.21.0.txt # # undone
update to release note

---
doc/source/whatsnew/v0.21.0.txt | 1 -
1 file changed, 1 deletion(-)

diff --git a/doc/source/whatsnew/v0.21.0.txt b/doc/source/whatsnew/v0.21.0.txt
index e4c50ec93f9..91d3e9e7b93 100644
--- a/doc/source/whatsnew/v0.21.0.txt
+++ b/doc/source/whatsnew/v0.21.0.txt
@@ -259,7 +259,6 @@ Indexing
- Fixes bug where indexing with ``np.inf`` caused an ``OverflowError`` to be raised (:issue:`16957`)
- Bug in reindexing on an empty ``CategoricalIndex`` (:issue:`16770`)
- Fixes ``DataFrame.loc`` for setting with alignment and tz-aware ``DatetimeIndex`` (:issue:`16889`)
-- Fixes ``test_argsort``, ``test_numpy_argsort`` to cover both `>` and `<` in the error message (:issue:`17046`)

I/O
^^^
48 changes: 48 additions & 0 deletions debian/patches/up_tst_np_argsort_comparison2
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
From 480d5745e1443de6e91a9f9c42d94e29705a3f43 Mon Sep 17 00:00:00 2001
From: ysau <yatshan.au@gmail.com>
Date: Fri, 21 Jul 2017 16:29:12 -0700
Subject: [PATCH] # Issue 17046 # # modified:
/pandas/tests/indexes/test_base.py, #
/doc/source/whatsnew/v0.21.0.txt # # Include both '>' and '<' in the error
message in # TestMixedIntIndex.test_argsort and #
TestMixedIntIndex.test_numpy_argsort

---
doc/source/whatsnew/v0.21.0.txt | 1 +
pandas/tests/indexes/test_base.py | 4 ++--
2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/doc/source/whatsnew/v0.21.0.txt b/doc/source/whatsnew/v0.21.0.txt
index 91d3e9e7b93..e4c50ec93f9 100644
--- a/doc/source/whatsnew/v0.21.0.txt
+++ b/doc/source/whatsnew/v0.21.0.txt
@@ -259,6 +259,7 @@ Indexing
- Fixes bug where indexing with ``np.inf`` caused an ``OverflowError`` to be raised (:issue:`16957`)
- Bug in reindexing on an empty ``CategoricalIndex`` (:issue:`16770`)
- Fixes ``DataFrame.loc`` for setting with alignment and tz-aware ``DatetimeIndex`` (:issue:`16889`)
+- Fixes ``test_argsort``, ``test_numpy_argsort`` to cover both `>` and `<` in the error message (:issue:`17046`)

I/O
^^^
diff --git a/pandas/tests/indexes/test_base.py b/pandas/tests/indexes/test_base.py
index 692cdd49579..842e8fea0df 100644
--- a/pandas/tests/indexes/test_base.py
+++ b/pandas/tests/indexes/test_base.py
@@ -1846,7 +1846,7 @@ def create_index(self):
def test_argsort(self):
idx = self.create_index()
if PY36:
- with tm.assert_raises_regex(TypeError, "'>' not supported"):
+ with tm.assert_raises_regex(TypeError, "'>|<' not supported"):
result = idx.argsort()
elif PY3:
with tm.assert_raises_regex(TypeError, "unorderable types"):
@@ -1859,7 +1859,7 @@ def test_argsort(self):
def test_numpy_argsort(self):
idx = self.create_index()
if PY36:
- with tm.assert_raises_regex(TypeError, "'>' not supported"):
+ with tm.assert_raises_regex(TypeError, "'>|<' not supported"):
result = np.argsort(idx)
elif PY3:
with tm.assert_raises_regex(TypeError, "unorderable types"):

0 comments on commit f3181af

Please sign in to comment.