Skip to content

Add MaskType to other cases #1073

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Dec 17, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 2 additions & 9 deletions pandas-stubs/core/indexes/base.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ from pandas._typing import (
HashableT,
Label,
Level,
MaskType,
NaPosition,
TimedeltaDtypeArg,
TimestampDtypeArg,
Expand Down Expand Up @@ -368,15 +369,7 @@ class Index(IndexOpsMixin[S1]):
@overload
def __getitem__(
self,
idx: (
slice
| np_ndarray_anyint
| Sequence[int]
| Index
| Series[bool]
| Sequence[bool]
| np_ndarray_bool
),
idx: slice | np_ndarray_anyint | Sequence[int] | Index | MaskType,
) -> Self: ...
@overload
def __getitem__(self, idx: int | tuple[np_ndarray_anyint, ...]) -> S1: ...
Expand Down
4 changes: 2 additions & 2 deletions pandas-stubs/core/indexes/interval.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import pandas as pd
from pandas import Index
from pandas.core.indexes.extension import ExtensionIndex
from pandas.core.series import (
Series,
TimedeltaSeries,
TimestampSeries,
)
Expand All @@ -31,6 +30,7 @@ from pandas._typing import (
IntervalClosedType,
IntervalT,
Label,
MaskType,
np_ndarray_anyint,
np_ndarray_bool,
npt,
Expand Down Expand Up @@ -254,7 +254,7 @@ class IntervalIndex(ExtensionIndex[IntervalT], IntervalMixin):
| np_ndarray_anyint
| Sequence[int]
| Index
| Series[bool]
| MaskType
| np_ndarray_bool
),
) -> IntervalIndex[IntervalT]: ...
Expand Down
11 changes: 2 additions & 9 deletions pandas-stubs/core/indexes/multi.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ from pandas._typing import (
Dtype,
DtypeArg,
HashableT,
MaskType,
np_ndarray_anyint,
np_ndarray_bool,
)
Expand Down Expand Up @@ -114,15 +115,7 @@ class MultiIndex(Index[Any]):
@overload # type: ignore[override]
def __getitem__(
self,
idx: (
slice
| np_ndarray_anyint
| Sequence[int]
| Index
| pd.Series[bool]
| Sequence[bool]
| np_ndarray_bool
),
idx: slice | np_ndarray_anyint | Sequence[int] | Index | MaskType,
) -> Self: ...
@overload
def __getitem__( # pyright: ignore[reportIncompatibleMethodOverride]
Expand Down
13 changes: 2 additions & 11 deletions pandas-stubs/core/indexes/range.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,12 @@ from collections.abc import Sequence
from typing import overload

import numpy as np
from pandas import Series
from pandas.core.indexes.base import Index

from pandas._typing import (
HashableT,
MaskType,
np_ndarray_anyint,
np_ndarray_bool,
npt,
)

Expand Down Expand Up @@ -73,15 +72,7 @@ class RangeIndex(Index[int]):
@overload # type: ignore[override]
def __getitem__(
self,
idx: (
slice
| np_ndarray_anyint
| Sequence[int]
| Index
| Series[bool]
| Sequence[bool]
| np_ndarray_bool
),
idx: slice | np_ndarray_anyint | Sequence[int] | Index | MaskType,
) -> Index: ...
@overload
def __getitem__( # pyright: ignore[reportIncompatibleMethodOverride]
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ packages = [{ "include" = "pandas-stubs" }]
[tool.poetry.dependencies]
python = ">=3.10"
types-pytz = ">= 2022.1.1"
numpy = ">= 1.23.5"
numpy = ">= 1.23.5,< 2.2.0" # wait till numpy 2.2.1 to clear

[tool.poetry.group.dev.dependencies]
mypy = "1.13.0"
Expand Down
Loading