Skip to content

Commit 5a0b4bc

Browse files
author
MomIsBestFriend
committed
Fixes for @jbrockmendel review
1 parent 77009b7 commit 5a0b4bc

File tree

3 files changed

+5
-6
lines changed

3 files changed

+5
-6
lines changed

pandas/core/internals/blocks.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ def make_block_same_class(self, values, placement=None, ndim=None):
261261

262262
def __repr__(self) -> str:
263263
# don't want to print out all of the items here
264-
name = pprint_thing(type(self).__name__)
264+
name = type(self).__name__
265265
if self._is_single_block:
266266

267267
result = "{name}: {len} dtype: {dtype}".format(

pandas/core/internals/managers.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,7 @@ def __len__(self) -> int:
321321
return len(self.items)
322322

323323
def __repr__(self) -> str:
324-
output = pprint_thing(type(self).__name__)
324+
output = type(self).__name__
325325
for i, ax in enumerate(self.axes):
326326
if i == 0:
327327
output += "\nItems: {ax}".format(ax=ax)

pandas/core/series.py

+3-4
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,7 @@ def __init__(
256256
elif is_extension_array_dtype(data):
257257
pass
258258
elif isinstance(data, (set, frozenset)):
259-
raise TypeError("{0!r} type is unordered".format(type(data).__name__))
259+
raise TypeError(f"{repr(type(data).__name__)} type is unordered")
260260
elif isinstance(data, ABCSparseArray):
261261
# handle sparse passed here (and force conversion)
262262
data = data.to_dense()
@@ -1569,9 +1569,8 @@ def to_string(
15691569
# catch contract violations
15701570
if not isinstance(result, str):
15711571
raise AssertionError(
1572-
"result must be of type unicode, type"
1573-
" of result is {0!r}"
1574-
"".format(type(result).__name__)
1572+
"result must be of type str, type"
1573+
f" of result is {repr(type(result).__name__)}"
15751574
)
15761575

15771576
if buf is None:

0 commit comments

Comments
 (0)