Skip to content

Commit 874aa8c

Browse files
check_untyped_defs pandas.core.groupby.groupby
1 parent 0a1f6d6 commit 874aa8c

File tree

2 files changed

+5
-7
lines changed

2 files changed

+5
-7
lines changed

pandas/core/groupby/groupby.py

+5-4
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ class providing the base-class of operations.
1212
import datetime
1313
from functools import partial, wraps
1414
import types
15-
from typing import FrozenSet, List, Optional, Tuple, Type, Union
15+
from typing import Dict, FrozenSet, List, Optional, Tuple, Type, Union
1616

1717
import numpy as np
1818

@@ -849,7 +849,7 @@ def _transform_should_cast(self, func_nm):
849849
)
850850

851851
def _cython_transform(self, how, numeric_only=True, **kwargs):
852-
output = collections.OrderedDict()
852+
output: Dict = collections.OrderedDict()
853853
for name, obj in self._iterate_slices():
854854
is_numeric = is_numeric_dtype(obj.dtype)
855855
if numeric_only and not is_numeric:
@@ -2259,7 +2259,7 @@ def _get_cythonized_result(
22592259
)
22602260

22612261
labels, _, ngroups = grouper.group_info
2262-
output = collections.OrderedDict()
2262+
output: Dict = collections.OrderedDict()
22632263
base_func = getattr(libgroupby, how)
22642264

22652265
for name, obj in self._iterate_slices():
@@ -2502,7 +2502,8 @@ def _reindex_output(self, output):
25022502

25032503

25042504
@Appender(GroupBy.__doc__)
2505-
def groupby(obj, by, **kwds):
2505+
def groupby(obj: Union[Series, DataFrame], by, **kwds) -> GroupBy:
2506+
klass: Type[GroupBy]
25062507
if isinstance(obj, Series):
25072508
from pandas.core.groupby.generic import SeriesGroupBy
25082509

setup.cfg

-3
Original file line numberDiff line numberDiff line change
@@ -203,9 +203,6 @@ check_untyped_defs=False
203203
[mypy-pandas.core.groupby.generic]
204204
check_untyped_defs=False
205205

206-
[mypy-pandas.core.groupby.groupby]
207-
check_untyped_defs=False
208-
209206
[mypy-pandas.core.indexes.datetimes]
210207
check_untyped_defs=False
211208

0 commit comments

Comments
 (0)