Skip to content

Commit 3f573c7

Browse files
committed
use np_1darray alias
1 parent e124d56 commit 3f573c7

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

pandas-stubs/core/indexes/period.pyi

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ from pandas._typing import (
2222
AxesData,
2323
Dtype,
2424
Frequency,
25+
np_1darray,
2526
)
2627

2728
class PeriodIndex(DatetimeIndexOpsMixin[pd.Period, np.object_], PeriodIndexFieldOps):
@@ -34,7 +35,7 @@ class PeriodIndex(DatetimeIndexOpsMixin[pd.Period, np.object_], PeriodIndexField
3435
name: Hashable | None = None,
3536
) -> Self: ...
3637
@property
37-
def values(self) -> np.ndarray[tuple[int], np.dtype[np.object_]]: ...
38+
def values(self) -> np_1darray[np.object_]: ...
3839
@overload
3940
def __sub__(self, other: Period) -> Index: ...
4041
@overload
@@ -57,7 +58,7 @@ class PeriodIndex(DatetimeIndexOpsMixin[pd.Period, np.object_], PeriodIndexField
5758
self,
5859
where: pd.DatetimeIndex | PeriodIndex,
5960
mask: np.ndarray[tuple[int], np.dtype[np.bool_]],
60-
) -> np.ndarray[tuple[int], np.dtype[np.intp]]: ...
61+
) -> np_1darray[np.intp]: ...
6162
@property
6263
def is_full(self) -> bool: ...
6364
@property

tests/test_indexes.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1509,8 +1509,6 @@ def test_period_index_asof_locs() -> None:
15091509
where = pd.DatetimeIndex(["2023-05-30 00:12:00", "2023-06-01 00:00:00"])
15101510
mask = np.ones(2, dtype=bool)
15111511
check(
1512-
assert_type(
1513-
idx.asof_locs(where, mask), np.ndarray[tuple[int], np.dtype[np.intp]]
1514-
),
1515-
np.ndarray,
1512+
assert_type(idx.asof_locs(where, mask), np_1darray[np.intp]),
1513+
np_1darray[np.intp],
15161514
)

0 commit comments

Comments
 (0)