@@ -64,6 +64,7 @@ from pandas.core.indexes.accessors import (
64
64
TimedeltaProperties ,
65
65
TimestampProperties ,
66
66
)
67
+ from pandas .core .indexes .base import UnknownIndex
67
68
from pandas .core .indexes .category import CategoricalIndex
68
69
from pandas .core .indexes .datetimes import DatetimeIndex
69
70
from pandas .core .indexes .interval import IntervalIndex
@@ -258,7 +259,7 @@ class Series(IndexOpsMixin[S1], NDFrame):
258
259
dtype : Dtype = ...,
259
260
name : Hashable = ...,
260
261
copy : bool = ...,
261
- ) -> Series [ Any ] : ...
262
+ ) -> UnknownSeries : ...
262
263
@overload
263
264
def __new__ (
264
265
cls ,
@@ -424,7 +425,7 @@ class Series(IndexOpsMixin[S1], NDFrame):
424
425
dtype : Dtype = ...,
425
426
name : Hashable = ...,
426
427
copy : bool = ...,
427
- ) -> Series : ...
428
+ ) -> UnknownSeries : ...
428
429
@property
429
430
def hasnans (self ) -> bool : ...
430
431
def div (
@@ -748,7 +749,7 @@ class Series(IndexOpsMixin[S1], NDFrame):
748
749
@overload
749
750
def groupby (
750
751
self ,
751
- by : CategoricalIndex | Index | Series ,
752
+ by : CategoricalIndex | UnknownIndex | UnknownSeries ,
752
753
axis : AxisIndex = ...,
753
754
level : IndexLabel | None = ...,
754
755
as_index : _bool = ...,
@@ -831,15 +832,15 @@ class Series(IndexOpsMixin[S1], NDFrame):
831
832
self , other : ArrayLike | dict [_str , np .ndarray ] | Sequence [S1 ] | Index [S1 ]
832
833
) -> np .ndarray : ...
833
834
@overload
834
- def __matmul__ (self , other : Series ) -> Scalar : ...
835
+ def __matmul__ (self , other : UnknownSeries ) -> Scalar : ...
835
836
@overload
836
- def __matmul__ (self , other : DataFrame ) -> Series : ...
837
+ def __matmul__ (self , other : DataFrame ) -> UnknownSeries : ...
837
838
@overload
838
839
def __matmul__ (self , other : np .ndarray ) -> np .ndarray : ...
839
840
@overload
840
- def __rmatmul__ (self , other : Series ) -> Scalar : ...
841
+ def __rmatmul__ (self , other : UnknownSeries ) -> Scalar : ...
841
842
@overload
842
- def __rmatmul__ (self , other : DataFrame ) -> Series : ...
843
+ def __rmatmul__ (self , other : DataFrame ) -> UnknownSeries : ...
843
844
@overload
844
845
def __rmatmul__ (self , other : np .ndarray ) -> np .ndarray : ...
845
846
@overload
@@ -859,15 +860,15 @@ class Series(IndexOpsMixin[S1], NDFrame):
859
860
@overload
860
861
def compare (
861
862
self ,
862
- other : Series ,
863
+ other : UnknownSeries ,
863
864
align_axis : AxisIndex ,
864
865
keep_shape : bool = ...,
865
866
keep_equal : bool = ...,
866
- ) -> Series : ...
867
+ ) -> UnknownSeries : ...
867
868
@overload
868
869
def compare (
869
870
self ,
870
- other : Series ,
871
+ other : UnknownSeries ,
871
872
align_axis : AxisColumn = ...,
872
873
keep_shape : bool = ...,
873
874
keep_equal : bool = ...,
@@ -986,7 +987,7 @@ class Series(IndexOpsMixin[S1], NDFrame):
986
987
axis : AxisIndex = ...,
987
988
* args : Any ,
988
989
** kwargs : Any ,
989
- ) -> Series : ...
990
+ ) -> UnknownSeries : ...
990
991
agg = aggregate
991
992
@overload
992
993
def transform (
@@ -1013,7 +1014,7 @@ class Series(IndexOpsMixin[S1], NDFrame):
1013
1014
convertDType : _bool = ...,
1014
1015
args : tuple = ...,
1015
1016
** kwargs : Any ,
1016
- ) -> Series : ...
1017
+ ) -> UnknownSeries : ...
1017
1018
@overload
1018
1019
def apply (
1019
1020
self ,
@@ -1025,20 +1026,20 @@ class Series(IndexOpsMixin[S1], NDFrame):
1025
1026
@overload
1026
1027
def apply (
1027
1028
self ,
1028
- func : Callable [..., Series ],
1029
+ func : Callable [..., UnknownSeries ],
1029
1030
convertDType : _bool = ...,
1030
1031
args : tuple = ...,
1031
1032
** kwargs : Any ,
1032
1033
) -> DataFrame : ...
1033
1034
def align (
1034
1035
self ,
1035
- other : DataFrame | Series ,
1036
+ other : DataFrame | UnknownSeries ,
1036
1037
join : JoinHow = ...,
1037
1038
axis : Axis | None = ...,
1038
1039
level : Level | None = ...,
1039
1040
copy : _bool = ...,
1040
1041
fill_value : Scalar | NAType | None = ...,
1041
- ) -> tuple [Series , Series ]: ...
1042
+ ) -> tuple [UnknownSeries , UnknownSeries ]: ...
1042
1043
@overload
1043
1044
def rename (
1044
1045
self ,
@@ -1133,7 +1134,7 @@ class Series(IndexOpsMixin[S1], NDFrame):
1133
1134
freq : Frequency | timedelta | None = ...,
1134
1135
axis : AxisIndex = ...,
1135
1136
fill_value : object | None = ...,
1136
- ) -> Series : ...
1137
+ ) -> UnknownSeries : ...
1137
1138
def info (
1138
1139
self ,
1139
1140
verbose : bool | None = ...,
@@ -1506,11 +1507,15 @@ class Series(IndexOpsMixin[S1], NDFrame):
1506
1507
tuple [
1507
1508
Sequence [bool ]
1508
1509
| Series [bool ]
1509
- | Callable [[Series ], Series | np .ndarray | Sequence [bool ]],
1510
- ListLikeU | Scalar | Callable [[Series ], Series | np .ndarray ],
1510
+ | Callable [
1511
+ [UnknownSeries ], UnknownSeries | np .ndarray | Sequence [bool ]
1512
+ ],
1513
+ ListLikeU
1514
+ | Scalar
1515
+ | Callable [[UnknownSeries ], UnknownSeries | np .ndarray ],
1511
1516
],
1512
1517
],
1513
- ) -> Series : ...
1518
+ ) -> UnknownSeries : ...
1514
1519
def truncate (
1515
1520
self ,
1516
1521
before : date | _str | int | None = ...,
@@ -1581,8 +1586,16 @@ class Series(IndexOpsMixin[S1], NDFrame):
1581
1586
@overload
1582
1587
def __add__ (
1583
1588
self ,
1584
- other : num | _str | timedelta | Timedelta | _ListLike | Series | np .timedelta64 ,
1585
- ) -> Series : ...
1589
+ other : (
1590
+ num
1591
+ | _str
1592
+ | timedelta
1593
+ | Timedelta
1594
+ | _ListLike
1595
+ | UnknownSeries
1596
+ | np .timedelta64
1597
+ ),
1598
+ ) -> UnknownSeries : ...
1586
1599
# ignore needed for mypy as we want different results based on the arguments
1587
1600
@overload # type: ignore[override]
1588
1601
def __and__ ( # pyright: ignore[reportOverlappingOverload]
@@ -1613,7 +1626,7 @@ class Series(IndexOpsMixin[S1], NDFrame):
1613
1626
self , other : timedelta | Timedelta | TimedeltaSeries | np .timedelta64
1614
1627
) -> TimedeltaSeries : ...
1615
1628
@overload
1616
- def __mul__ (self , other : num | _ListLike | Series ) -> Series : ...
1629
+ def __mul__ (self , other : num | _ListLike | UnknownSeries ) -> UnknownSeries : ...
1617
1630
def __mod__ (self , other : num | _ListLike | Series [S1 ]) -> Series [S1 ]: ...
1618
1631
def __ne__ (self , other : object ) -> Series [_bool ]: ... # type: ignore[override] # pyright: ignore[reportIncompatibleMethodOverride]
1619
1632
def __pow__ (self , other : num | _ListLike | Series [S1 ]) -> Series [S1 ]: ...
@@ -1629,7 +1642,9 @@ class Series(IndexOpsMixin[S1], NDFrame):
1629
1642
@overload
1630
1643
def __radd__ (self , other : S1 | Series [S1 ]) -> Self : ...
1631
1644
@overload
1632
- def __radd__ (self , other : num | _str | _ListLike | Series ) -> Series : ...
1645
+ def __radd__ (
1646
+ self , other : num | _str | _ListLike | UnknownSeries
1647
+ ) -> UnknownSeries : ...
1633
1648
# ignore needed for mypy as we want different results based on the arguments
1634
1649
@overload # type: ignore[override]
1635
1650
def __rand__ ( # pyright: ignore[reportOverlappingOverload]
@@ -1648,7 +1663,7 @@ class Series(IndexOpsMixin[S1], NDFrame):
1648
1663
self , other : timedelta | Timedelta | TimedeltaSeries | np .timedelta64
1649
1664
) -> TimedeltaSeries : ...
1650
1665
@overload
1651
- def __rmul__ (self , other : num | _ListLike | Series ) -> Series : ...
1666
+ def __rmul__ (self , other : num | _ListLike | UnknownSeries ) -> UnknownSeries : ...
1652
1667
def __rnatmul__ (self , other : num | _ListLike | Series [S1 ]) -> Series [S1 ]: ...
1653
1668
def __rpow__ (self , other : num | _ListLike | Series [S1 ]) -> Series [S1 ]: ...
1654
1669
# ignore needed for mypy as we want different results based on the arguments
@@ -1660,8 +1675,10 @@ class Series(IndexOpsMixin[S1], NDFrame):
1660
1675
def __ror__ ( # pyright: ignore[reportIncompatibleMethodOverride]
1661
1676
self , other : int | np_ndarray_anyint | Series [int ]
1662
1677
) -> Series [int ]: ...
1663
- def __rsub__ (self , other : num | _ListLike | Series [S1 ]) -> Series : ...
1664
- def __rtruediv__ (self , other : num | _ListLike | Series [S1 ] | Path ) -> Series : ...
1678
+ def __rsub__ (self , other : num | _ListLike | Series [S1 ]) -> UnknownSeries : ...
1679
+ def __rtruediv__ (
1680
+ self , other : num | _ListLike | Series [S1 ] | Path
1681
+ ) -> UnknownSeries : ...
1665
1682
# ignore needed for mypy as we want different results based on the arguments
1666
1683
@overload # type: ignore[override]
1667
1684
def __rxor__ ( # pyright: ignore[reportOverlappingOverload]
@@ -1686,8 +1703,10 @@ class Series(IndexOpsMixin[S1], NDFrame):
1686
1703
self , other : Timestamp | datetime | TimestampSeries
1687
1704
) -> TimedeltaSeries : ...
1688
1705
@overload
1689
- def __sub__ (self , other : num | _ListLike | Series ) -> Series : ...
1690
- def __truediv__ (self , other : num | _ListLike | Series [S1 ] | Path ) -> Series : ...
1706
+ def __sub__ (self , other : num | _ListLike | UnknownSeries ) -> UnknownSeries : ...
1707
+ def __truediv__ (
1708
+ self , other : num | _ListLike | Series [S1 ] | Path
1709
+ ) -> UnknownSeries : ...
1691
1710
# ignore needed for mypy as we want different results based on the arguments
1692
1711
@overload # type: ignore[override]
1693
1712
def __xor__ ( # pyright: ignore[reportOverlappingOverload]
@@ -1792,12 +1811,12 @@ class Series(IndexOpsMixin[S1], NDFrame):
1792
1811
min_periods : int = ...,
1793
1812
adjust : _bool = ...,
1794
1813
ignore_na : _bool = ...,
1795
- ) -> ExponentialMovingWindow [Series ]: ...
1814
+ ) -> ExponentialMovingWindow [UnknownSeries ]: ...
1796
1815
def expanding (
1797
1816
self ,
1798
1817
min_periods : int = ...,
1799
1818
method : CalculationMethod = ...,
1800
- ) -> Expanding [Series ]: ...
1819
+ ) -> Expanding [UnknownSeries ]: ...
1801
1820
def floordiv (
1802
1821
self ,
1803
1822
other : num | _ListLike | Series [S1 ],
@@ -1900,11 +1919,11 @@ class Series(IndexOpsMixin[S1], NDFrame):
1900
1919
@overload
1901
1920
def mul (
1902
1921
self ,
1903
- other : num | _ListLike | Series ,
1922
+ other : num | _ListLike | UnknownSeries ,
1904
1923
level : Level | None = ...,
1905
1924
fill_value : float | None = ...,
1906
1925
axis : AxisIndex | None = ...,
1907
- ) -> Series : ...
1926
+ ) -> UnknownSeries : ...
1908
1927
def multiply (
1909
1928
self ,
1910
1929
other : num | _ListLike | Series [S1 ],
@@ -1984,11 +2003,11 @@ class Series(IndexOpsMixin[S1], NDFrame):
1984
2003
@overload
1985
2004
def rmul (
1986
2005
self ,
1987
- other : num | _ListLike | Series ,
2006
+ other : num | _ListLike | UnknownSeries ,
1988
2007
level : Level | None = ...,
1989
2008
fill_value : float | None = ...,
1990
2009
axis : AxisIndex = ...,
1991
- ) -> Series : ...
2010
+ ) -> UnknownSeries : ...
1992
2011
@overload
1993
2012
def rolling (
1994
2013
self ,
@@ -2001,7 +2020,7 @@ class Series(IndexOpsMixin[S1], NDFrame):
2001
2020
method : CalculationMethod = ...,
2002
2021
* ,
2003
2022
win_type : _str ,
2004
- ) -> Window [Series ]: ...
2023
+ ) -> Window [UnknownSeries ]: ...
2005
2024
@overload
2006
2025
def rolling (
2007
2026
self ,
@@ -2014,7 +2033,7 @@ class Series(IndexOpsMixin[S1], NDFrame):
2014
2033
method : CalculationMethod = ...,
2015
2034
* ,
2016
2035
win_type : None = ...,
2017
- ) -> Rolling [Series ]: ...
2036
+ ) -> Rolling [UnknownSeries ]: ...
2018
2037
def rpow (
2019
2038
self ,
2020
2039
other : Series [S1 ] | Scalar ,
0 commit comments