@@ -427,7 +427,7 @@ def __contains__(self, item: object) -> bool | np.bool_:
427
427
if not self ._can_hold_na :
428
428
return False
429
429
elif item is self .dtype .na_value or isinstance (item , self .dtype .type ):
430
- return self ._hasnans
430
+ return self ._hasna
431
431
else :
432
432
return False
433
433
else :
@@ -606,7 +606,7 @@ def isna(self) -> np.ndarray | ExtensionArraySupportsAnyAll:
606
606
raise AbstractMethodError (self )
607
607
608
608
@property
609
- def _hasnans (self ) -> bool :
609
+ def _hasna (self ) -> bool :
610
610
# GH#22680
611
611
"""
612
612
Equivalent to `self.isna().any()`.
@@ -698,7 +698,7 @@ def argmin(self, skipna: bool = True) -> int:
698
698
ExtensionArray.argmax
699
699
"""
700
700
validate_bool_kwarg (skipna , "skipna" )
701
- if not skipna and self ._hasnans :
701
+ if not skipna and self ._hasna :
702
702
raise NotImplementedError
703
703
return nargminmax (self , "argmin" )
704
704
@@ -722,7 +722,7 @@ def argmax(self, skipna: bool = True) -> int:
722
722
ExtensionArray.argmin
723
723
"""
724
724
validate_bool_kwarg (skipna , "skipna" )
725
- if not skipna and self ._hasnans :
725
+ if not skipna and self ._hasna :
726
726
raise NotImplementedError
727
727
return nargminmax (self , "argmax" )
728
728
@@ -1534,6 +1534,9 @@ def _empty(cls, shape: Shape, dtype: ExtensionDtype):
1534
1534
ExtensionDtype.empty
1535
1535
ExtensionDtype.empty is the 'official' public version of this API.
1536
1536
"""
1537
+ # Implementer note: while ExtensionDtype.empty is the public way to
1538
+ # call this method, it is still required to implement this `_empty`
1539
+ # method as well (it is called internally in pandas)
1537
1540
obj = cls ._from_sequence ([], dtype = dtype )
1538
1541
1539
1542
taker = np .broadcast_to (np .intp (- 1 ), shape )
0 commit comments