@@ -72,7 +72,7 @@ from pandas._libs.tslibs import BaseOffset
72
72
from pandas ._libs .tslibs .nattype import NaTType
73
73
from pandas ._libs .tslibs .offsets import DateOffset
74
74
from pandas ._typing import (
75
- S1 ,
75
+ S2 ,
76
76
AggFuncTypeBase ,
77
77
AggFuncTypeDictFrame ,
78
78
AggFuncTypeDictSeries ,
@@ -1315,11 +1315,11 @@ class DataFrame(NDFrame, OpsMixin, _GetItemHack):
1315
1315
@overload
1316
1316
def stack (
1317
1317
self , level : Level | list [Level ] = ..., dropna : _bool = ..., sort : _bool = ...
1318
- ) -> Self | Series [ Any ] : ...
1318
+ ) -> Self | Series : ...
1319
1319
@overload
1320
1320
def stack (
1321
1321
self , level : Level | list [Level ] = ..., future_stack : _bool = ...
1322
- ) -> Self | Series [ Any ] : ...
1322
+ ) -> Self | Series : ...
1323
1323
def explode (
1324
1324
self , column : Sequence [Hashable ], ignore_index : _bool = ...
1325
1325
) -> Self : ...
@@ -1379,7 +1379,7 @@ class DataFrame(NDFrame, OpsMixin, _GetItemHack):
1379
1379
@overload
1380
1380
def apply (
1381
1381
self ,
1382
- f : Callable [..., ListLikeExceptSeriesAndStr | Series [ Any ] ],
1382
+ f : Callable [..., ListLikeExceptSeriesAndStr | Series ],
1383
1383
axis : AxisIndex = ...,
1384
1384
raw : _bool = ...,
1385
1385
result_type : None = ...,
@@ -1389,13 +1389,13 @@ class DataFrame(NDFrame, OpsMixin, _GetItemHack):
1389
1389
@overload
1390
1390
def apply (
1391
1391
self ,
1392
- f : Callable [..., S1 | NAType ],
1392
+ f : Callable [..., S2 | NAType ],
1393
1393
axis : AxisIndex = ...,
1394
1394
raw : _bool = ...,
1395
1395
result_type : None = ...,
1396
1396
args : Any = ...,
1397
1397
** kwargs : Any ,
1398
- ) -> Series [S1 ]: ...
1398
+ ) -> Series [S2 ]: ...
1399
1399
# Since non-scalar type T is not supported in Series[T],
1400
1400
# we separate this overload from the above one
1401
1401
@overload
@@ -1407,24 +1407,24 @@ class DataFrame(NDFrame, OpsMixin, _GetItemHack):
1407
1407
result_type : None = ...,
1408
1408
args : Any = ...,
1409
1409
** kwargs : Any ,
1410
- ) -> Series [ Any ] : ...
1410
+ ) -> Series : ...
1411
1411
1412
1412
# apply() overloads with keyword result_type, and axis does not matter
1413
1413
@overload
1414
1414
def apply (
1415
1415
self ,
1416
- f : Callable [..., S1 | NAType ],
1416
+ f : Callable [..., S2 | NAType ],
1417
1417
axis : Axis = ...,
1418
1418
raw : _bool = ...,
1419
1419
args : Any = ...,
1420
1420
* ,
1421
1421
result_type : Literal ["expand" , "reduce" ],
1422
1422
** kwargs : Any ,
1423
- ) -> Series [S1 ]: ...
1423
+ ) -> Series [S2 ]: ...
1424
1424
@overload
1425
1425
def apply (
1426
1426
self ,
1427
- f : Callable [..., ListLikeExceptSeriesAndStr | Series [ Any ] | Mapping [Any , Any ]],
1427
+ f : Callable [..., ListLikeExceptSeriesAndStr | Series | Mapping [Any , Any ]],
1428
1428
axis : Axis = ...,
1429
1429
raw : _bool = ...,
1430
1430
args : Any = ...,
@@ -1442,12 +1442,12 @@ class DataFrame(NDFrame, OpsMixin, _GetItemHack):
1442
1442
* ,
1443
1443
result_type : Literal ["reduce" ],
1444
1444
** kwargs : Any ,
1445
- ) -> Series [ Any ] : ...
1445
+ ) -> Series : ...
1446
1446
@overload
1447
1447
def apply (
1448
1448
self ,
1449
1449
f : Callable [
1450
- ..., ListLikeExceptSeriesAndStr | Series [ Any ] | Scalar | Mapping [Any , Any ]
1450
+ ..., ListLikeExceptSeriesAndStr | Series | Scalar | Mapping [Any , Any ]
1451
1451
],
1452
1452
axis : Axis = ...,
1453
1453
raw : _bool = ...,
@@ -1461,27 +1461,27 @@ class DataFrame(NDFrame, OpsMixin, _GetItemHack):
1461
1461
@overload
1462
1462
def apply (
1463
1463
self ,
1464
- f : Callable [..., Series [ Any ] ],
1464
+ f : Callable [..., Series ],
1465
1465
axis : AxisIndex = ...,
1466
1466
raw : _bool = ...,
1467
1467
args : Any = ...,
1468
1468
* ,
1469
1469
result_type : Literal ["reduce" ],
1470
1470
** kwargs : Any ,
1471
- ) -> Series [ Any ] : ...
1471
+ ) -> Series : ...
1472
1472
1473
1473
# apply() overloads with default result_type of None, and keyword axis=1 matters
1474
1474
@overload
1475
1475
def apply (
1476
1476
self ,
1477
- f : Callable [..., S1 | NAType ],
1477
+ f : Callable [..., S2 | NAType ],
1478
1478
raw : _bool = ...,
1479
1479
result_type : None = ...,
1480
1480
args : Any = ...,
1481
1481
* ,
1482
1482
axis : AxisColumn ,
1483
1483
** kwargs : Any ,
1484
- ) -> Series [S1 ]: ...
1484
+ ) -> Series [S2 ]: ...
1485
1485
@overload
1486
1486
def apply (
1487
1487
self ,
@@ -1492,11 +1492,11 @@ class DataFrame(NDFrame, OpsMixin, _GetItemHack):
1492
1492
* ,
1493
1493
axis : AxisColumn ,
1494
1494
** kwargs : Any ,
1495
- ) -> Series [ Any ] : ...
1495
+ ) -> Series : ...
1496
1496
@overload
1497
1497
def apply (
1498
1498
self ,
1499
- f : Callable [..., Series [ Any ] ],
1499
+ f : Callable [..., Series ],
1500
1500
raw : _bool = ...,
1501
1501
result_type : None = ...,
1502
1502
args : Any = ...,
@@ -1509,7 +1509,7 @@ class DataFrame(NDFrame, OpsMixin, _GetItemHack):
1509
1509
@overload
1510
1510
def apply (
1511
1511
self ,
1512
- f : Callable [..., Series [ Any ] ],
1512
+ f : Callable [..., Series ],
1513
1513
raw : _bool = ...,
1514
1514
args : Any = ...,
1515
1515
* ,
@@ -1534,7 +1534,7 @@ class DataFrame(NDFrame, OpsMixin, _GetItemHack):
1534
1534
) -> Self : ...
1535
1535
def merge (
1536
1536
self ,
1537
- right : DataFrame | Series [ Any ] ,
1537
+ right : DataFrame | Series ,
1538
1538
how : MergeHow = ...,
1539
1539
on : IndexLabel | AnyArrayLike | None = ...,
1540
1540
left_on : IndexLabel | AnyArrayLike | None = ...,
@@ -2008,7 +2008,7 @@ class DataFrame(NDFrame, OpsMixin, _GetItemHack):
2008
2008
| Callable [[DataFrame ], DataFrame ]
2009
2009
| Callable [[Any ], _bool ]
2010
2010
),
2011
- other : Scalar | Series [S1 ] | DataFrame | Callable | NAType | None = ...,
2011
+ other : Scalar | Series [S2 ] | DataFrame | Callable | NAType | None = ...,
2012
2012
* ,
2013
2013
inplace : Literal [True ],
2014
2014
axis : Axis | None = ...,
@@ -2024,7 +2024,7 @@ class DataFrame(NDFrame, OpsMixin, _GetItemHack):
2024
2024
| Callable [[DataFrame ], DataFrame ]
2025
2025
| Callable [[Any ], _bool ]
2026
2026
),
2027
- other : Scalar | Series [S1 ] | DataFrame | Callable | NAType | None = ...,
2027
+ other : Scalar | Series [S2 ] | DataFrame | Callable | NAType | None = ...,
2028
2028
* ,
2029
2029
inplace : Literal [False ] = ...,
2030
2030
axis : Axis | None = ...,
0 commit comments