File tree 2 files changed +7
-6
lines changed
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):
432
432
433
433
elif isinstance (value , SparseArray ):
434
434
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' )
437
437
clean = value
438
438
439
439
elif hasattr (value , '__iter__' ):
@@ -443,8 +443,8 @@ def sp_maker(x, index=None):
443
443
clean = sp_maker (clean )
444
444
else :
445
445
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' )
448
448
clean = sp_maker (value )
449
449
450
450
# Scalar
Original file line number Diff line number Diff line change @@ -568,8 +568,9 @@ def _check_frame(frame, orig):
568
568
assert len (frame ['I' ].sp_values ) == N // 2
569
569
570
570
# 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 ):
573
574
frame ['foo' ] = np .random .randn (N - 1 )
574
575
575
576
# scalar value
You can’t perform that action at this time.
0 commit comments