11"""Test module for classes in pandas.api.typing."""
22
3- from typing import Literal # noqa: F401
4- from typing import TYPE_CHECKING
5-
63import numpy as np
74import pandas as pd
85from pandas .api .typing import (
1310)
1411from typing_extensions import assert_type
1512
16- from pandas ._typing import Scalar # noqa: F401
17-
1813from tests import check
1914
20- if TYPE_CHECKING :
21- from pandas .core .groupby .groupby import _ResamplerGroupBy # noqa: F401
22-
2315
2416def test_dataframegroupby ():
2517 df = pd .DataFrame ({"a" : [1 , 2 , 3 ]})
2618 check (
27- assert_type (df .groupby ("a" ), " DataFrameGroupBy[Scalar, Literal[True]]" ),
19+ assert_type (df .groupby ("a" ), DataFrameGroupBy ),
2820 DataFrameGroupBy ,
2921 )
3022
3123
3224def test_seriesgroupby ():
3325 sr : pd .Series [int ] = pd .Series ([1 , 2 , 3 ], index = pd .Index (["a" , "b" , "a" ]))
3426 check (
35- assert_type (sr .groupby (level = 0 ), " SeriesGroupBy[int, Scalar]" ),
27+ assert_type (sr .groupby (level = 0 ), SeriesGroupBy ),
3628 SeriesGroupBy ,
3729 )
3830
@@ -44,7 +36,7 @@ def tests_datetimeindexersamplergroupby() -> None:
4436 )
4537 gb_df = df .groupby ("col2" )
4638 check (
47- assert_type (gb_df .resample ("ME" ), "_ResamplerGroupBy[pd.DataFrame]" ),
39+ assert_type (gb_df .resample ("ME" ), DatetimeIndexResamplerGroupby ),
4840 DatetimeIndexResamplerGroupby ,
4941 pd .DataFrame ,
5042 )
0 commit comments