File tree 3 files changed +6
-8
lines changed
3 files changed +6
-8
lines changed Original file line number Diff line number Diff line change @@ -676,7 +676,7 @@ def __repr__(self):
676
676
dtype = self .dtype )
677
677
678
678
def _formatter (self , boxed = False ):
679
- # type: (bool) -> Callable[[Any], str]
679
+ # type: (bool) -> Callable[[Any], Optional[ str] ]
680
680
"""Formatting function for scalar values.
681
681
682
682
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):
1739
1739
index = printing .pprint_thing (self .sp_index ))
1740
1740
1741
1741
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
1748
1743
1749
1744
1750
1745
SparseArray ._add_arithmetic_ops ()
Original file line number Diff line number Diff line change @@ -1123,9 +1123,12 @@ class ExtensionArrayFormatter(GenericArrayFormatter):
1123
1123
def _format_strings (self ):
1124
1124
values = self .values
1125
1125
if isinstance (values , (ABCIndexClass , ABCSeries )):
1126
+ boxed = True
1126
1127
values = values ._values
1128
+ else :
1129
+ boxed = False
1127
1130
1128
- formatter = values ._formatter (self )
1131
+ formatter = values ._formatter (boxed = boxed )
1129
1132
1130
1133
if is_categorical_dtype (values .dtype ):
1131
1134
# Categorical is special for now, so that we can preserve tzinfo
You can’t perform that action at this time.
0 commit comments