File tree 2 files changed +3
-3
lines changed
2 files changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -394,7 +394,7 @@ def nested_renaming_depr(level=4):
394
394
nested_renaming_depr ()
395
395
elif isinstance (obj , ABCDataFrame ) and \
396
396
k not in obj .columns :
397
- raise ValueError (
397
+ raise KeyError (
398
398
"Column '{col}' does not exist!" .format (col = k ))
399
399
400
400
arg = new_arg
Original file line number Diff line number Diff line change @@ -613,7 +613,7 @@ def f():
613
613
t [['A' ]].agg ({'A' : ['sum' , 'std' ],
614
614
'B' : ['mean' , 'std' ]})
615
615
616
- pytest .raises (ValueError , f )
616
+ pytest .raises (KeyError , f )
617
617
618
618
def test_agg_nested_dicts (self ):
619
619
@@ -668,7 +668,7 @@ def test_try_aggregate_non_existing_column(self):
668
668
df = DataFrame (data ).set_index ('dt' )
669
669
670
670
# Error as we don't have 'z' column
671
- with pytest .raises (ValueError ):
671
+ with pytest .raises (KeyError ):
672
672
df .resample ('30T' ).agg ({'x' : ['mean' ],
673
673
'y' : ['median' ],
674
674
'z' : ['sum' ]})
You can’t perform that action at this time.
0 commit comments