|
| 1 | +# pyright: reportUnknownArgumentType=false |
1 | 2 | from __future__ import annotations |
2 | 3 |
|
3 | 4 | from collections.abc import ( |
|
102 | 103 | ) |
103 | 104 |
|
104 | 105 | if not PD_LTE_23: |
105 | | - from pandas.errors import Pandas4Warning # type: ignore[attr-defined] # pyright: ignore[reportAttributeAccessIssue,reportRedeclaration] # isort: skip |
| 106 | + from pandas.errors import Pandas4Warning # pyright: ignore[reportRedeclaration] |
106 | 107 | else: |
107 | 108 | Pandas4Warning: TypeAlias = FutureWarning # type: ignore[no-redef] |
108 | 109 |
|
@@ -1160,20 +1161,8 @@ def transform_func( |
1160 | 1161 | pd.Series, |
1161 | 1162 | float, |
1162 | 1163 | ) |
1163 | | - check( |
1164 | | - assert_type( |
1165 | | - s.groupby(lambda x: x).transform("mean"), |
1166 | | - "pd.Series", |
1167 | | - ), |
1168 | | - pd.Series, |
1169 | | - ) |
1170 | | - check( |
1171 | | - assert_type( |
1172 | | - s.groupby(lambda x: x).transform("first"), |
1173 | | - "pd.Series", |
1174 | | - ), |
1175 | | - pd.Series, |
1176 | | - ) |
| 1164 | + check(assert_type(s.groupby(lambda x: x).transform("mean"), pd.Series), pd.Series) |
| 1165 | + check(assert_type(s.groupby(lambda x: x).transform("first"), pd.Series), pd.Series) |
1177 | 1166 |
|
1178 | 1167 |
|
1179 | 1168 | def test_types_groupby_aggregate() -> None: |
@@ -3254,11 +3243,7 @@ def first_arg_series( |
3254 | 3243 | check( |
3255 | 3244 | assert_type( |
3256 | 3245 | ser.pipe( |
3257 | | - first_arg_series, |
3258 | | - 1, |
3259 | | - [1.0, 2.0], |
3260 | | - argument_2="hi", |
3261 | | - keyword_only=(1, 2), |
| 3246 | + first_arg_series, 1, [1.0, 2.0], argument_2="hi", keyword_only=(1, 2) |
3262 | 3247 | ), |
3263 | 3248 | pd.Series, |
3264 | 3249 | ), |
@@ -3319,16 +3304,7 @@ def first_arg_series( |
3319 | 3304 | def first_arg_not_series(argument_1: int, ser: pd.Series) -> pd.Series: |
3320 | 3305 | return ser |
3321 | 3306 |
|
3322 | | - check( |
3323 | | - assert_type( |
3324 | | - ser.pipe( |
3325 | | - (first_arg_not_series, "ser"), |
3326 | | - 1, |
3327 | | - ), |
3328 | | - pd.Series, |
3329 | | - ), |
3330 | | - pd.Series, |
3331 | | - ) |
| 3307 | + check(assert_type(ser.pipe((first_arg_not_series, "ser"), 1), pd.Series), pd.Series) |
3332 | 3308 |
|
3333 | 3309 | if TYPE_CHECKING_INVALID_USAGE: |
3334 | 3310 | ser.pipe( |
|
0 commit comments