@@ -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)
@@ -66,11 +66,13 @@ _ExtendedAnyArrayLike: TypeAlias = AnyArrayLike | ArrayLike
6666@overload
6767def pivot_table (
6868 data : DataFrame ,
69- values : _PivotTableValuesTypes = None ,
70- index : _PivotTableIndexTypes = None ,
71- columns : _PivotTableColumnsTypes = None ,
69+ values : _PivotTableValuesTypes [ Hashable ] = None ,
70+ index : _PivotTableIndexTypes [ Hashable ] = None ,
71+ columns : _PivotTableColumnsTypes [ Hashable ] = None ,
7272 aggfunc : (
73- _PivotAggFunc | Sequence [_PivotAggFunc ] | Mapping [Hashable , _PivotAggFunc ]
73+ _PivotAggFunc [Any ]
74+ | Sequence [_PivotAggFunc [Any ]]
75+ | Mapping [Hashable , _PivotAggFunc [Any ]]
7476 ) = "mean" ,
7577 fill_value : Scalar | None = None ,
7678 margins : bool = False ,
@@ -84,12 +86,14 @@ def pivot_table(
8486@overload
8587def pivot_table (
8688 data : DataFrame ,
87- values : _PivotTableValuesTypes = None ,
89+ values : _PivotTableValuesTypes [ Hashable ] = None ,
8890 * ,
8991 index : Grouper ,
90- columns : _PivotTableColumnsTypes | np_ndarray | Index [Any ] = None ,
92+ columns : _PivotTableColumnsTypes [ Hashable ] | np_ndarray | Index [Any ] = None ,
9193 aggfunc : (
92- _PivotAggFunc | Sequence [_PivotAggFunc ] | Mapping [Hashable , _PivotAggFunc ]
94+ _PivotAggFunc [Any ]
95+ | Sequence [_PivotAggFunc [Any ]]
96+ | Mapping [Hashable , _PivotAggFunc [Any ]]
9397 ) = "mean" ,
9498 fill_value : Scalar | None = None ,
9599 margins : bool = False ,
@@ -101,12 +105,14 @@ def pivot_table(
101105@overload
102106def pivot_table (
103107 data : DataFrame ,
104- values : _PivotTableValuesTypes = None ,
105- index : _PivotTableIndexTypes | np_ndarray | Index [Any ] = None ,
108+ values : _PivotTableValuesTypes [ Hashable ] = None ,
109+ index : _PivotTableIndexTypes [ Hashable ] | np_ndarray | Index [Any ] = None ,
106110 * ,
107111 columns : Grouper ,
108112 aggfunc : (
109- _PivotAggFunc | Sequence [_PivotAggFunc ] | Mapping [Hashable , _PivotAggFunc ]
113+ _PivotAggFunc [Any ]
114+ | Sequence [_PivotAggFunc [Any ]]
115+ | Mapping [Hashable , _PivotAggFunc [Any ]]
110116 ) = "mean" ,
111117 fill_value : Scalar | None = None ,
112118 margins : bool = False ,
0 commit comments