Closed
Description
Describe the bug
The type hint for pandas.core.groupby.generic.DataFrameGroupBy.resample
says it returns a pandas.core.groupby.grouper.Grouper
; however in at least some situations this function can return a pandas.core.resample.DatetimeIndexResamplerGroupby
, which is not a Grouper.
To Reproduce
This results in a false positive on MyPy 1.7.1:
df.set_index("date").groupby("intensity").resample("90D")["duration"]
The error message is
error: Value of type "Grouper" is not indexable [index]
Please complete the following information:
Python 3.11
Mypy 1.7.1
pandas-stubs 2.1.1.230928
Metadata
Metadata
Assignees
Labels
No labels