Skip to content

Commit dba1bda

Browse files
committed
move UnknownSeries and UnknownIndex location
1 parent bcdd40e commit dba1bda

File tree

5 files changed

+8
-6
lines changed

5 files changed

+8
-6
lines changed

pandas-stubs/_typing.pyi

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -576,9 +576,6 @@ S2 = TypeVar(
576576
| list[str],
577577
)
578578

579-
class UnknownSeries(Series[Any]): ...
580-
class UnknownIndex(Index[Any]): ...
581-
582579
IndexingInt: TypeAlias = (
583580
int | np.int_ | np.integer | np.unsignedinteger | np.signedinteger | np.int8
584581
)

pandas-stubs/core/indexes/base.pyi

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -455,6 +455,8 @@ class Index(IndexOpsMixin[S1]):
455455
),
456456
) -> Self: ...
457457

458+
class UnknownIndex(Index[Any]): ...
459+
458460
def ensure_index_from_sequences(
459461
sequences: Sequence[Sequence[Dtype]], names: list[str] = ...
460462
) -> Index: ...

pandas-stubs/core/series.pyi

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2133,6 +2133,8 @@ class Series(IndexOpsMixin[S1], NDFrame):
21332133
) -> Self: ...
21342134
def __bool__(self) -> NoReturn: ...
21352135

2136+
class UnknownSeries(Series[Any]): ...
2137+
21362138
class TimestampSeries(Series[Timestamp]):
21372139
@property
21382140
def dt(self) -> TimestampProperties: ... # type: ignore[override] # pyright: ignore[reportIncompatibleMethodOverride]

pandas-stubs/core/strings.pyi

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,14 @@ from pandas import (
2121
Series,
2222
)
2323
from pandas.core.base import NoNewAttributesMixin
24+
from pandas.core.indexes.base import UnknownIndex
25+
from pandas.core.series import UnknownSeries
2426

2527
from pandas._libs.tslibs.nattype import NaTType
2628
from pandas._typing import (
2729
JoinHow,
2830
Scalar,
2931
T,
30-
UnknownIndex,
31-
UnknownSeries,
3232
np_ndarray_bool,
3333
)
3434

tests/test_series.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,8 @@
7373
OffsetSeries: TypeAlias = pd.Series
7474

7575
if TYPE_CHECKING:
76+
from pandas.core.series import UnknownSeries # noqa: F401
77+
7678
from pandas._typing import (
7779
BooleanDtypeArg,
7880
BytesDtypeArg,
@@ -87,7 +89,6 @@
8789
UIntDtypeArg,
8890
VoidDtypeArg,
8991
)
90-
from pandas._typing import UnknownSeries # noqa: F401
9192
from pandas._typing import np_ndarray_int # noqa: F401
9293

9394
# Tests will use numpy 2.1 in python 3.10 or later

0 commit comments

Comments
 (0)