1
1
from __future__ import annotations
2
2
3
- from functools import partial
4
3
import operator
5
4
import re
6
5
from typing import (
63
62
64
63
from pandas .core .dtypes .dtypes import ExtensionDtype
65
64
66
- from pandas import Series
67
-
68
65
69
66
ArrowStringScalarOrNAT = Union [str , libmissing .NAType ]
70
67
@@ -559,16 +556,13 @@ def _rank(
559
556
560
557
class ArrowStringArrayNumpySemantics (ArrowStringArray ):
561
558
_na_value = np .nan
562
-
563
- def __getattribute__ (self , item ):
564
- # ArrowStringArray and we both inherit from ArrowExtensionArray, which
565
- # creates inheritance problems (Diamond inheritance)
566
- if item in ArrowStringArrayMixin .__dict__ and item not in (
567
- "_pa_array" ,
568
- "__dict__" ,
569
- ):
570
- return partial (getattr (ArrowStringArrayMixin , item ), self )
571
- return super ().__getattribute__ (item )
559
+ _str_get = ArrowStringArrayMixin ._str_get
560
+ _str_removesuffix = ArrowStringArrayMixin ._str_removesuffix
561
+ _str_capitalize = ArrowStringArrayMixin ._str_capitalize
562
+ _str_pad = ArrowStringArrayMixin ._str_pad
563
+ _str_title = ArrowStringArrayMixin ._str_title
564
+ _str_swapcase = ArrowStringArrayMixin ._str_swapcase
565
+ _str_slice_replace = ArrowStringArrayMixin ._str_slice_replace
572
566
573
567
def _cmp_method (self , other , op ):
574
568
try :
@@ -579,11 +573,3 @@ def _cmp_method(self, other, op):
579
573
return result .to_numpy (np .bool_ , na_value = True )
580
574
else :
581
575
return result .to_numpy (np .bool_ , na_value = False )
582
-
583
- def value_counts (self , dropna : bool = True ) -> Series :
584
- from pandas import Series
585
-
586
- result = super ().value_counts (dropna )
587
- return Series (
588
- result ._values .to_numpy (), index = result .index , name = result .name , copy = False
589
- )
0 commit comments