File tree Expand file tree Collapse file tree 3 files changed +6
-8
lines changed Expand file tree Collapse file tree 3 files changed +6
-8
lines changed Original file line number Diff line number Diff line change @@ -676,7 +676,7 @@ def __repr__(self):
676676 dtype = self .dtype )
677677
678678 def _formatter (self , boxed = False ):
679- # type: (bool) -> Callable[[Any], str]
679+ # type: (bool) -> Callable[[Any], Optional[ str] ]
680680 """Formatting function for scalar values.
681681
682682 This is used in the default '__repr__'. The returned formatting
Original file line number Diff line number Diff line change @@ -1739,12 +1739,7 @@ def __unicode__(self):
17391739 index = printing .pprint_thing (self .sp_index ))
17401740
17411741 def _formatter (self , boxed = False ):
1742- def fmt (x ):
1743- if isna (x ) and isinstance (x , float ):
1744- return 'NaN'
1745- return str (x )
1746-
1747- return fmt
1742+ return None
17481743
17491744
17501745SparseArray ._add_arithmetic_ops ()
Original file line number Diff line number Diff line change @@ -1123,9 +1123,12 @@ class ExtensionArrayFormatter(GenericArrayFormatter):
11231123 def _format_strings (self ):
11241124 values = self .values
11251125 if isinstance (values , (ABCIndexClass , ABCSeries )):
1126+ boxed = True
11261127 values = values ._values
1128+ else :
1129+ boxed = False
11271130
1128- formatter = values ._formatter (self )
1131+ formatter = values ._formatter (boxed = boxed )
11291132
11301133 if is_categorical_dtype (values .dtype ):
11311134 # Categorical is special for now, so that we can preserve tzinfo
You can’t perform that action at this time.
0 commit comments