Skip to content

Commit

Permalink
Brock feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
WillAyd committed Jan 4, 2025
1 parent 305fee3 commit 25087f7
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 23 deletions.
3 changes: 1 addition & 2 deletions pandas/_libs/lib.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -834,8 +834,7 @@ cpdef ndarray[object] ensure_string_array(
if isinstance(val, bytes):
# GH#49658 discussion of desired behavior here
result[i] = val.decode()
elif isinstance(val, np.ndarray):
# TODO(wayd): is_float_object actually returns true for this...
elif util.is_array(val):
result[i] = str(val.tolist())
elif not util.is_float_object(val):
# f"{val}" is faster than str(val)
Expand Down
21 changes: 0 additions & 21 deletions pandas/io/formats/format.py
Original file line number Diff line number Diff line change
Expand Up @@ -1467,27 +1467,6 @@ def _format_strings(self) -> list[str]:
return fmt_values


class _NullFormatter(_GenericArrayFormatter):
def _format_strings(self) -> list[str]:
fmt_values = [str(x) for x in self.values]
return fmt_values


class _ListFormatter(_GenericArrayFormatter):
def _format_strings(self) -> list[str]:
# TODO(wayd): This doesn't seem right - where should missing values
# be handled
fmt_values = []
for x in self.values:
pyval = x.as_py()
if pyval:
fmt_values.append(pyval)
else:
fmt_values.append("")

return fmt_values


class _Datetime64Formatter(_GenericArrayFormatter):
values: DatetimeArray

Expand Down

0 comments on commit 25087f7

Please sign in to comment.