@@ -44,13 +44,7 @@ class providing the base-class of operations.
44
44
from pandas .core import nanops
45
45
import pandas .core .algorithms as algorithms
46
46
from pandas .core .arrays import Categorical
47
- from pandas .core .base import (
48
- DataError ,
49
- GroupByError ,
50
- PandasObject ,
51
- SelectionMixin ,
52
- SpecificationError ,
53
- )
47
+ from pandas .core .base import DataError , PandasObject , SelectionMixin
54
48
import pandas .core .common as com
55
49
from pandas .core .construction import extract_array
56
50
from pandas .core .frame import DataFrame
@@ -862,8 +856,6 @@ def _cython_transform(self, how, numeric_only=True, **kwargs):
862
856
result , names = self .grouper .transform (obj .values , how , ** kwargs )
863
857
except NotImplementedError :
864
858
continue
865
- except AssertionError as e :
866
- raise GroupByError (str (e ))
867
859
if self ._transform_should_cast (how ):
868
860
output [name ] = self ._try_cast (result , obj )
869
861
else :
@@ -890,12 +882,7 @@ def _cython_agg_general(self, how, alt=None, numeric_only=True, min_count=-1):
890
882
if numeric_only and not is_numeric :
891
883
continue
892
884
893
- try :
894
- result , names = self .grouper .aggregate (
895
- obj .values , how , min_count = min_count
896
- )
897
- except AssertionError as e :
898
- raise GroupByError (str (e ))
885
+ result , names = self .grouper .aggregate (obj .values , how , min_count = min_count )
899
886
output [name ] = self ._try_cast (result , obj )
900
887
901
888
if len (output ) == 0 :
@@ -1353,8 +1340,8 @@ def f(self, **kwargs):
1353
1340
# try a cython aggregation if we can
1354
1341
try :
1355
1342
return self ._cython_agg_general (alias , alt = npfunc , ** kwargs )
1356
- except AssertionError as e :
1357
- raise SpecificationError ( str ( e ))
1343
+ except AssertionError :
1344
+ raise
1358
1345
except DataError :
1359
1346
pass
1360
1347
except Exception :
0 commit comments