From 4bae23daaba2a8fd2ba2613cc8f8048456ba372e Mon Sep 17 00:00:00 2001 From: Sathvik Mulukutla Date: Thu, 14 Dec 2023 17:26:21 +0530 Subject: [PATCH 1/2] Updated test_where.py to account for updated exceptions. --- pandas/tests/frame/indexing/test_where.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pandas/tests/frame/indexing/test_where.py b/pandas/tests/frame/indexing/test_where.py index 3d36d0471f02f..7a66b247ebcaa 100644 --- a/pandas/tests/frame/indexing/test_where.py +++ b/pandas/tests/frame/indexing/test_where.py @@ -250,7 +250,7 @@ def test_where_invalid_input_single(self, cond): df = DataFrame({"a": [1, 2, 3]}) msg = "Boolean array expected for the condition" - with pytest.raises(ValueError, match=msg): + with pytest.raises(TypeError, match=msg): df.where(cond) @pytest.mark.parametrize( @@ -272,7 +272,7 @@ def test_where_invalid_input_multiple(self, cond): df = DataFrame({"a": [1, 2, 3], "b": [2, 2, 2]}) msg = "Boolean array expected for the condition" - with pytest.raises(ValueError, match=msg): + with pytest.raises(TypeError, match=msg): df.where(cond) def test_where_dataframe_col_match(self): From bcdae4eb00ee60a1d812c17bf7d8537bb135ef63 Mon Sep 17 00:00:00 2001 From: Sathvik Mulukutla Date: Thu, 14 Dec 2023 17:30:06 +0530 Subject: [PATCH 2/2] Update test_indexing.py to account for modified exceptions --- pandas/tests/frame/indexing/test_indexing.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandas/tests/frame/indexing/test_indexing.py b/pandas/tests/frame/indexing/test_indexing.py index 4be5be77b015c..929814cc8c03c 100644 --- a/pandas/tests/frame/indexing/test_indexing.py +++ b/pandas/tests/frame/indexing/test_indexing.py @@ -137,7 +137,7 @@ def test_getitem_boolean(self, mixed_float_frame, mixed_int_frame, datetime_fram subframe_obj = datetime_frame[indexer_obj] tm.assert_frame_equal(subframe_obj, subframe) - with pytest.raises(ValueError, match="Boolean array expected"): + with pytest.raises(TypeError, match="Boolean array expected"): datetime_frame[datetime_frame] # test that Series work