@@ -857,31 +857,29 @@ def test_modulo_zero_int(self):
857
857
tm .assert_series_equal (result , expected )
858
858
859
859
def test_np_array_mul_ea_array_returns_extensionarray (self ):
860
+ # GH#61866
860
861
np_array = np .array ([1 , 2 , 3 , 4 , 5 ], dtype = np .int64 )
861
862
ea_array = array ([1 , 2 , 3 , 4 , 5 ], dtype = "Int64" )
862
863
result = np_array * ea_array
863
864
assert isinstance (result , type (ea_array ))
864
865
tm .assert_equal (result , array ([1 , 4 , 9 , 16 , 25 ], dtype = "Int64" ))
865
866
866
- def test_df_mul_np_and_ea_array_shape_and_errors (self ):
867
- df = pd .DataFrame (np .arange (50 ).reshape (10 , 5 )).notna ().values
868
- NP_array = np .array (list (range (10 )), dtype = np .int64 ).reshape (10 , 1 )
869
- EA_array = array (list (range (10 )), dtype = "Int64" ).reshape (10 , 1 )
870
- result_np = df * NP_array
871
- assert isinstance (result_np , np .ndarray )
872
- tm .assert_equal (result_np .shape , (10 , 5 ))
873
-
874
- with pytest .raises (NotImplementedError ):
875
- _ = df * EA_array
876
-
877
- def test_non_1d_ea_raises_typeerror (self ):
867
+ def test_non_1d_ea_raises_notimplementederror (self ):
868
+ # GH#61866
878
869
ea_array = array ([1 , 2 , 3 , 4 , 5 ], dtype = "Int64" ).reshape (5 , 1 )
879
870
np_array = np .array ([1 , 2 , 3 , 4 , 5 ], dtype = np .int64 ).reshape (5 , 1 )
880
871
881
- with pytest .raises (NotImplementedError ):
882
- _ = ea_array * np_array
883
- with pytest .raises (NotImplementedError ):
884
- _ = np_array * ea_array
872
+ with pytest .raises (
873
+ NotImplementedError ,
874
+ match = "non-1D ExtensionArray operations are not supported" ,
875
+ ):
876
+ ea_array * np_array
877
+
878
+ with pytest .raises (
879
+ NotImplementedError ,
880
+ match = "non-1D ExtensionArray operations are not supported" ,
881
+ ):
882
+ np_array * ea_array
885
883
886
884
887
885
class TestAdditionSubtraction :
0 commit comments