File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change 99import numbers
1010import sys
1111from typing import (
12+ TYPE_CHECKING ,
1213 Any ,
1314 cast ,
1415 overload ,
4041 SequenceIndexer ,
4142 SequenceNotStr ,
4243 TakeIndexer ,
43- np_1darray ,
4444)
4545
4646from pandas .core .dtypes .base import ExtensionDtype
5050 pandas_dtype ,
5151)
5252
53+ if TYPE_CHECKING :
54+ from pandas ._typing import np_1darray
55+
5356
5457@register_extension_dtype
5558class DecimalDtype (ExtensionDtype ):
@@ -200,7 +203,8 @@ def __getitem__(self, item: ScalarIndexer | SequenceIndexer) -> Any:
200203 return self ._data [item ]
201204 # array, slice.
202205 item = check_array_indexer (
203- self , item # type: ignore[arg-type] # pyright: ignore[reportArgumentType,reportCallIssue]
206+ self ,
207+ item , # type: ignore[arg-type] # pyright: ignore[reportArgumentType,reportCallIssue]
204208 )
205209 return type (self )(self ._data [item ])
206210
@@ -270,7 +274,9 @@ def nbytes(self) -> int:
270274 return 0
271275
272276 def isna (self ) -> np_1darray [np .bool_ ]:
273- return np .array ([x .is_nan () for x in self ._data ], dtype = bool )
277+ if sys .version_info < (3 , 11 ):
278+ return np .array ([x .is_nan () for x in self ._data ], bool ) # type: ignore[return-value] # pyright: ignore[reportReturnType]
279+ return np .array ([x .is_nan () for x in self ._data ], bool )
274280
275281 @property
276282 def _na_value (self ) -> decimal .Decimal :
You can’t perform that action at this time.
0 commit comments