@@ -34,8 +34,8 @@ from pandas._typing import (
3434
3535_PivotAggCallable : TypeAlias = Callable [[Series ], ScalarT ]
3636
37- _PivotAggFunc : TypeAlias = ( # pyright: ignore[reportUnknownVariableType]
38- _PivotAggCallable
37+ _PivotAggFunc : TypeAlias = (
38+ _PivotAggCallable [ ScalarT ]
3939 | np .ufunc
4040 | Literal ["mean" , "sum" , "count" , "min" , "max" , "median" , "std" , "var" ]
4141)
@@ -67,11 +67,13 @@ _Values: TypeAlias = SequenceNotStr[Any] | _ExtendedAnyArrayLike
6767@overload
6868def pivot_table (
6969 data : DataFrame ,
70- values : _PivotTableValuesTypes = None ,
71- index : _PivotTableIndexTypes = None ,
72- columns : _PivotTableColumnsTypes = None ,
70+ values : _PivotTableValuesTypes [ Hashable ] = None ,
71+ index : _PivotTableIndexTypes [ Hashable ] = None ,
72+ columns : _PivotTableColumnsTypes [ Hashable ] = None ,
7373 aggfunc : (
74- _PivotAggFunc | Sequence [_PivotAggFunc ] | Mapping [Hashable , _PivotAggFunc ]
74+ _PivotAggFunc [Any ]
75+ | Sequence [_PivotAggFunc [Any ]]
76+ | Mapping [Hashable , _PivotAggFunc [Any ]]
7577 ) = "mean" ,
7678 fill_value : Scalar | None = None ,
7779 margins : bool = False ,
@@ -85,12 +87,14 @@ def pivot_table(
8587@overload
8688def pivot_table (
8789 data : DataFrame ,
88- values : _PivotTableValuesTypes = None ,
90+ values : _PivotTableValuesTypes [ Hashable ] = None ,
8991 * ,
9092 index : Grouper ,
91- columns : _PivotTableColumnsTypes | np_ndarray | Index [Any ] = None ,
93+ columns : _PivotTableColumnsTypes [ Hashable ] | np_ndarray | Index [Any ] = None ,
9294 aggfunc : (
93- _PivotAggFunc | Sequence [_PivotAggFunc ] | Mapping [Hashable , _PivotAggFunc ]
95+ _PivotAggFunc [Any ]
96+ | Sequence [_PivotAggFunc [Any ]]
97+ | Mapping [Hashable , _PivotAggFunc [Any ]]
9498 ) = "mean" ,
9599 fill_value : Scalar | None = None ,
96100 margins : bool = False ,
@@ -102,12 +106,14 @@ def pivot_table(
102106@overload
103107def pivot_table (
104108 data : DataFrame ,
105- values : _PivotTableValuesTypes = None ,
106- index : _PivotTableIndexTypes | np_ndarray | Index [Any ] = None ,
109+ values : _PivotTableValuesTypes [ Hashable ] = None ,
110+ index : _PivotTableIndexTypes [ Hashable ] | np_ndarray | Index [Any ] = None ,
107111 * ,
108112 columns : Grouper ,
109113 aggfunc : (
110- _PivotAggFunc | Sequence [_PivotAggFunc ] | Mapping [Hashable , _PivotAggFunc ]
114+ _PivotAggFunc [Any ]
115+ | Sequence [_PivotAggFunc [Any ]]
116+ | Mapping [Hashable , _PivotAggFunc [Any ]]
111117 ) = "mean" ,
112118 fill_value : Scalar | None = None ,
113119 margins : bool = False ,
0 commit comments