@@ -651,12 +651,10 @@ def should_store(self, value: ArrayLike) -> bool:
651651 """
652652 return is_dtype_equal (value .dtype , self .dtype )
653653
654- def to_native_types (self , slicer = None , na_rep = "nan" , quoting = None , ** kwargs ):
655- """ convert to our native types format, slicing if desired """
654+ def to_native_types (self , na_rep = "nan" , quoting = None , ** kwargs ):
655+ """ convert to our native types format """
656656 values = self .values
657657
658- if slicer is not None :
659- values = values [:, slicer ]
660658 mask = isna (values )
661659 itemsize = writers .word_len (na_rep )
662660
@@ -1715,11 +1713,9 @@ def get_values(self, dtype=None):
17151713 def array_values (self ) -> ExtensionArray :
17161714 return self .values
17171715
1718- def to_native_types (self , slicer = None , na_rep = "nan" , quoting = None , ** kwargs ):
1716+ def to_native_types (self , na_rep = "nan" , quoting = None , ** kwargs ):
17191717 """override to use ExtensionArray astype for the conversion"""
17201718 values = self .values
1721- if slicer is not None :
1722- values = values [slicer ]
17231719 mask = isna (values )
17241720
17251721 values = np .asarray (values .astype (object ))
@@ -1937,18 +1933,10 @@ def _can_hold_element(self, element: Any) -> bool:
19371933 )
19381934
19391935 def to_native_types (
1940- self ,
1941- slicer = None ,
1942- na_rep = "" ,
1943- float_format = None ,
1944- decimal = "." ,
1945- quoting = None ,
1946- ** kwargs ,
1936+ self , na_rep = "" , float_format = None , decimal = "." , quoting = None , ** kwargs ,
19471937 ):
1948- """ convert to our native types format, slicing if desired """
1938+ """ convert to our native types format """
19491939 values = self .values
1950- if slicer is not None :
1951- values = values [:, slicer ]
19521940
19531941 # see gh-13418: no special formatting is desired at the
19541942 # output (important for appropriate 'quoting' behaviour),
@@ -2131,17 +2119,11 @@ def _can_hold_element(self, element: Any) -> bool:
21312119
21322120 return is_valid_nat_for_dtype (element , self .dtype )
21332121
2134- def to_native_types (
2135- self , slicer = None , na_rep = None , date_format = None , quoting = None , ** kwargs
2136- ):
2122+ def to_native_types (self , na_rep = None , date_format = None , quoting = None , ** kwargs ):
21372123 """ convert to our native types format, slicing if desired """
21382124 values = self .values
21392125 i8values = self .values .view ("i8" )
21402126
2141- if slicer is not None :
2142- values = values [..., slicer ]
2143- i8values = i8values [..., slicer ]
2144-
21452127 from pandas .io .formats .format import _get_format_datetime64_from_values
21462128
21472129 fmt = _get_format_datetime64_from_values (values , date_format )
@@ -2387,11 +2369,9 @@ def fillna(self, value, **kwargs):
23872369 )
23882370 return super ().fillna (value , ** kwargs )
23892371
2390- def to_native_types (self , slicer = None , na_rep = None , quoting = None , ** kwargs ):
2391- """ convert to our native types format, slicing if desired """
2372+ def to_native_types (self , na_rep = None , quoting = None , ** kwargs ):
2373+ """ convert to our native types format """
23922374 values = self .values
2393- if slicer is not None :
2394- values = values [:, slicer ]
23952375 mask = isna (values )
23962376
23972377 rvalues = np .empty (values .shape , dtype = object )
0 commit comments