@@ -1040,17 +1040,15 @@ def _bool_agg(self, val_test, skipna):
10401040 Shared func to call any / all Cython GroupBy implementations.
10411041 """
10421042
1043- def objs_to_bool (vals ):
1044- # type: (np.ndarray) -> (np.ndarray, Type)
1043+ def objs_to_bool (vals : np .ndarray ) -> types .Tuple [np .ndarray , Type ]:
10451044 if is_object_dtype (vals ):
10461045 vals = np .array ([bool (x ) for x in vals ])
10471046 else :
10481047 vals = vals .astype (np .bool )
10491048
10501049 return vals .view (np .uint8 ), np .bool
10511050
1052- def result_to_bool (result , inference ):
1053- # type: (np.ndarray, Type) -> np.ndarray
1051+ def result_to_bool (result : np .ndarray , inference : Type ) -> np .ndarray :
10541052 return result .astype (inference , copy = False )
10551053
10561054 return self ._get_cythonized_result ('group_any_all' , self .grouper ,
@@ -1738,8 +1736,8 @@ def quantile(self, q=0.5, interpolation='linear'):
17381736 b 3.0
17391737 """
17401738
1741- def pre_processor (vals ):
1742- # type: (np.ndarray) -> ( np.ndarray, Optional[Type])
1739+ def pre_processor (vals : np . ndarray ) -> \
1740+ types . Tuple [ np .ndarray , Optional [Type ]]:
17431741 if is_object_dtype (vals ):
17441742 raise TypeError ("'quantile' cannot be performed against "
17451743 "'object' dtypes!" )
@@ -1753,8 +1751,8 @@ def pre_processor(vals):
17531751
17541752 return vals , inference
17551753
1756- def post_processor (vals , inference ):
1757- # type: (np.ndarray, Optional[Type]) -> np.ndarray
1754+ def post_processor (vals : np . ndarray , inference : Optional [ Type ]) -> \
1755+ np .ndarray :
17581756 if inference :
17591757 # Check for edge case
17601758 if not (is_integer_dtype (inference ) and
0 commit comments