Skip to content

Commit 5b684a3

Browse files
committed
fix: missing __array__
1 parent 1c98286 commit 5b684a3

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

pandas-stubs/core/arrays/datetimelike.pyi

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,14 @@ from pandas._libs import (
1818
)
1919
from pandas._typing import (
2020
DatetimeLikeScalar,
21+
NpDtype,
2122
PositionalIndexerTuple,
2223
ScalarIndexer,
2324
SequenceIndexer,
2425
TimeAmbiguous,
2526
TimeNonexistent,
2627
TimeUnit,
28+
np_1darray,
2729
)
2830

2931
DTScalarOrNaT: TypeAlias = DatetimeLikeScalar | NaTType
@@ -66,6 +68,9 @@ class DatetimeLikeArrayMixin(ExtensionOpsMixin, ExtensionArray):
6668
def asi8(self) -> np.ndarray: ...
6769
@property
6870
def nbytes(self): ...
71+
def __array__(
72+
self, dtype: NpDtype | None = None, copy: bool | None = None
73+
) -> np_1darray: ...
6974
@property
7075
def size(self) -> int: ...
7176
@overload

pandas-stubs/core/arrays/masked.pyi

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,11 @@ from pandas.core.arrays import (
1111
from typing_extensions import Self
1212

1313
from pandas._typing import (
14+
NpDtype,
1415
Scalar,
1516
ScalarIndexer,
1617
SequenceIndexer,
18+
np_1darray,
1719
npt,
1820
)
1921

@@ -31,6 +33,9 @@ class BaseMaskedArray(ExtensionArray, ExtensionOpsMixin):
3133
na_value: Scalar = ...,
3234
) -> np.ndarray: ...
3335
__array_priority__: int = ...
36+
def __array__(
37+
self, dtype: NpDtype | None = None, copy: bool | None = None
38+
) -> np_1darray: ...
3439
def __arrow_array__(self, type=...): ...
3540
def isna(self): ...
3641
@property

0 commit comments

Comments
 (0)