@@ -966,7 +966,8 @@ def __init__(self, obj, *args, **kwargs):
966
966
for attr in self ._attributes :
967
967
setattr (self , attr , kwargs .get (attr , getattr (parent , attr )))
968
968
969
- super ().__init__ (None )
969
+ # error: Too many arguments for "__init__" of "object"
970
+ super ().__init__ (None ) # type: ignore
970
971
self ._groupby = groupby
971
972
self ._groupby .mutated = True
972
973
self ._groupby .grouper .mutated = True
@@ -1553,7 +1554,7 @@ def _get_time_delta_bins(self, ax):
1553
1554
1554
1555
return binner , bins , labels
1555
1556
1556
- def _get_time_period_bins (self , ax ):
1557
+ def _get_time_period_bins (self , ax : DatetimeIndex ):
1557
1558
if not isinstance (ax , DatetimeIndex ):
1558
1559
raise TypeError (
1559
1560
"axis must be a DatetimeIndex, but got "
@@ -1569,13 +1570,13 @@ def _get_time_period_bins(self, ax):
1569
1570
labels = binner = period_range (start = ax [0 ], end = ax [- 1 ], freq = freq , name = ax .name )
1570
1571
1571
1572
end_stamps = (labels + freq ).asfreq (freq , "s" ).to_timestamp ()
1572
- if ax .tzinfo :
1573
- end_stamps = end_stamps .tz_localize (ax .tzinfo )
1573
+ if ax .tz :
1574
+ end_stamps = end_stamps .tz_localize (ax .tz )
1574
1575
bins = ax .searchsorted (end_stamps , side = "left" )
1575
1576
1576
1577
return binner , bins , labels
1577
1578
1578
- def _get_period_bins (self , ax ):
1579
+ def _get_period_bins (self , ax : PeriodIndex ):
1579
1580
if not isinstance (ax , PeriodIndex ):
1580
1581
raise TypeError (
1581
1582
"axis must be a PeriodIndex, but got "
@@ -1898,6 +1899,7 @@ def _asfreq_compat(index, freq):
1898
1899
raise ValueError (
1899
1900
"Can only set arbitrary freq for empty DatetimeIndex or TimedeltaIndex"
1900
1901
)
1902
+ new_index : Index
1901
1903
if isinstance (index , PeriodIndex ):
1902
1904
new_index = index .asfreq (freq = freq )
1903
1905
else :
0 commit comments