Skip to content

Commit eceb678

Browse files
author
MomIsBestFriend
committed
Fixed typing
1 parent 31b1528 commit eceb678

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

pandas/core/aggregation.py

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,16 @@
55

66
from collections import defaultdict
77
from functools import partial
8-
from typing import Any, DefaultDict, List, Sequence, Tuple
8+
from typing import TYPE_CHECKING, Any, DefaultDict, Hashable, List, Sequence, Tuple
99

1010
from pandas.core.dtypes.common import is_dict_like, is_list_like
1111

1212
import pandas.core.common as com
1313
from pandas.core.indexes.api import Index
1414

15+
if TYPE_CHECKING:
16+
import numpy as np
17+
1518

1619
def is_multi_agg_with_relabel(**kwargs) -> bool:
1720
"""
@@ -39,7 +42,9 @@ def is_multi_agg_with_relabel(**kwargs) -> bool:
3942
)
4043

4144

42-
def normalize_keyword_aggregation(kwargs: dict) -> Tuple[dict, List[str], List[int]]:
45+
def normalize_keyword_aggregation(
46+
kwargs: dict,
47+
) -> Tuple[DefaultDict, Tuple[Hashable], "np.ndarray"]:
4348
"""
4449
Normalize user-provided "named aggregation" kwargs.
4550
Transforms from the new ``Mapping[str, NamedAgg]`` style kwargs
@@ -51,11 +56,11 @@ def normalize_keyword_aggregation(kwargs: dict) -> Tuple[dict, List[str], List[i
5156
5257
Returns
5358
-------
54-
aggspec : dict
59+
aggspec : DefaultDict[list]
5560
The transformed kwargs.
56-
columns : List[str]
61+
columns : Tuple[Hashable]
5762
The user-provided keys.
58-
col_idx_order : List[int]
63+
col_idx_order : numpy.ndarray
5964
List of columns indices.
6065
6166
Examples

0 commit comments

Comments
 (0)