@@ -815,7 +815,8 @@ def test_astype_extension_dtypes_duplicate_col(self, dtype):
815
815
expected = concat ([a1 .astype (dtype ), a2 .astype (dtype )], axis = 1 )
816
816
tm .assert_frame_equal (result , expected )
817
817
818
- def test_df_where_with_category (self ):
818
+ @pytest .mark .parametrize ("kwargs" , [dict (), dict (other = None )])
819
+ def test_df_where_with_category (self , kwargs ):
819
820
# GH 16979
820
821
df = DataFrame (np .arange (2 * 3 ).reshape (2 , 3 ), columns = list ("ABC" ))
821
822
mask = np .array ([[True , False , True ], [False , True , True ]])
@@ -824,8 +825,8 @@ def test_df_where_with_category(self):
824
825
df .B = df .B .astype ("category" )
825
826
df .C = df .C .astype ("category" )
826
827
827
- expected = df .A .where (mask [:, 0 ])
828
- result = df . A . where ( mask [:, 0 ], other = None )
828
+ result = df .A .where (mask [:, 0 ], ** kwargs )
829
+ expected = Series ( pd . Categorical ([ 0 , np . nan ], categories = [ 0 , 3 ]), name = "A" )
829
830
tm .assert_series_equal (result , expected )
830
831
831
832
@pytest .mark .parametrize (
0 commit comments