File tree Expand file tree Collapse file tree 2 files changed +7
-6
lines changed Expand file tree Collapse file tree 2 files changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -432,8 +432,8 @@ def sp_maker(x, index=None):
432432
433433 elif  isinstance (value , SparseArray ):
434434 if  len (value ) !=  len (self .index ):
435-  raise  AssertionError ('Length of values does not match ' 
436-    'length of index' )
435+  raise  ValueError ('Length of values does not match ' 
436+  'length of index' )
437437 clean  =  value 
438438
439439 elif  hasattr (value , '__iter__' ):
@@ -443,8 +443,8 @@ def sp_maker(x, index=None):
443443 clean  =  sp_maker (clean )
444444 else :
445445 if  len (value ) !=  len (self .index ):
446-  raise  AssertionError ('Length of values does not match ' 
447-    'length of index' )
446+  raise  ValueError ('Length of values does not match ' 
447+  'length of index' )
448448 clean  =  sp_maker (value )
449449
450450 # Scalar 
Original file line number Diff line number Diff line change @@ -568,8 +568,9 @@ def _check_frame(frame, orig):
568568 assert  len (frame ['I' ].sp_values ) ==  N  //  2 
569569
570570 # insert ndarray wrong size 
571-  msg  =  "Length of values does not match length of index" 
572-  with  pytest .raises (AssertionError , match = msg ):
571+  # GH 25484 
572+  msg  =  'Length of values does not match length of index' 
573+  with  pytest .raises (ValueError , match = msg ):
573574 frame ['foo' ] =  np .random .randn (N  -  1 )
574575
575576 # scalar value 
                         You can’t perform that action at this time. 
           
                  
0 commit comments