@@ -44,13 +44,7 @@ class providing the base-class of operations.
4444from pandas .core import nanops
4545import pandas .core .algorithms as algorithms
4646from 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
5448import pandas .core .common as com
5549from pandas .core .construction import extract_array
5650from pandas .core .frame import DataFrame
@@ -862,8 +856,6 @@ def _cython_transform(self, how, numeric_only=True, **kwargs):
862856 result , names = self .grouper .transform (obj .values , how , ** kwargs )
863857 except NotImplementedError :
864858 continue
865- except AssertionError as e :
866- raise GroupByError (str (e ))
867859 if self ._transform_should_cast (how ):
868860 output [name ] = self ._try_cast (result , obj )
869861 else :
@@ -890,12 +882,7 @@ def _cython_agg_general(self, how, alt=None, numeric_only=True, min_count=-1):
890882 if numeric_only and not is_numeric :
891883 continue
892884
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 )
899886 output [name ] = self ._try_cast (result , obj )
900887
901888 if len (output ) == 0 :
@@ -1353,8 +1340,8 @@ def f(self, **kwargs):
13531340 # try a cython aggregation if we can
13541341 try :
13551342 return self ._cython_agg_general (alias , alt = npfunc , ** kwargs )
1356- except AssertionError as e :
1357- raise SpecificationError ( str ( e ))
1343+ except AssertionError :
1344+ raise
13581345 except DataError :
13591346 pass
13601347 except Exception :
0 commit comments