From eb24044175fede2c4535417e498a3738a8ff9d54 Mon Sep 17 00:00:00 2001 From: Daniel Saxton Date: Sun, 4 Oct 2020 13:16:55 -0500 Subject: [PATCH 1/3] CI: Update error message for np_dev --- pandas/tests/series/indexing/test_indexing.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/pandas/tests/series/indexing/test_indexing.py b/pandas/tests/series/indexing/test_indexing.py index 1fafdf00393e1..a794079103b7a 100644 --- a/pandas/tests/series/indexing/test_indexing.py +++ b/pandas/tests/series/indexing/test_indexing.py @@ -367,9 +367,12 @@ def test_2d_to_1d_assignment_raises(): x = np.random.randn(2, 2) y = pd.Series(range(2)) - msg = ( - r"shape mismatch: value array of shape \(2,2\) could not be " - r"broadcast to indexing result of shape \(2,\)" + msg = "|".join( + [ + r"shape mismatch: value array of shape \(2,2\) could not be " + r"broadcast to indexing result of shape \(2,\)", + r"cannot reshape array of size 4 into shape \(2,\)", + ] ) with pytest.raises(ValueError, match=msg): y.loc[range(2)] = x From a3bc454e524d9e6b1d051c03addf9da35d2c8912 Mon Sep 17 00:00:00 2001 From: Daniel Saxton Date: Sun, 4 Oct 2020 13:52:53 -0500 Subject: [PATCH 2/3] Comma --- pandas/tests/series/indexing/test_indexing.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandas/tests/series/indexing/test_indexing.py b/pandas/tests/series/indexing/test_indexing.py index a794079103b7a..eea1c1888e595 100644 --- a/pandas/tests/series/indexing/test_indexing.py +++ b/pandas/tests/series/indexing/test_indexing.py @@ -377,7 +377,7 @@ def test_2d_to_1d_assignment_raises(): with pytest.raises(ValueError, match=msg): y.loc[range(2)] = x - msg = r"could not broadcast input array from shape \(2,2\) into shape \(2\)" + msg = r"could not broadcast input array from shape \(2,2\) into shape \(2,\)" with pytest.raises(ValueError, match=msg): y.loc[:] = x From 574ca38f610145364ab342843b5425f16f714edc Mon Sep 17 00:00:00 2001 From: Daniel Saxton Date: Sun, 4 Oct 2020 14:01:38 -0500 Subject: [PATCH 3/3] Fix --- pandas/tests/series/indexing/test_indexing.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandas/tests/series/indexing/test_indexing.py b/pandas/tests/series/indexing/test_indexing.py index eea1c1888e595..fbdac2bb2d8e8 100644 --- a/pandas/tests/series/indexing/test_indexing.py +++ b/pandas/tests/series/indexing/test_indexing.py @@ -377,7 +377,7 @@ def test_2d_to_1d_assignment_raises(): with pytest.raises(ValueError, match=msg): y.loc[range(2)] = x - msg = r"could not broadcast input array from shape \(2,2\) into shape \(2,\)" + msg = r"could not broadcast input array from shape \(2,2\) into shape \(2,?\)" with pytest.raises(ValueError, match=msg): y.loc[:] = x