Skip to content

Commit

Permalink
Fixes for @jbrockmendel review
Browse files Browse the repository at this point in the history
  • Loading branch information
MomIsBestFriend committed Nov 27, 2019
1 parent 77009b7 commit 5a0b4bc
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion pandas/core/internals/blocks.py
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ def make_block_same_class(self, values, placement=None, ndim=None):

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

result = "{name}: {len} dtype: {dtype}".format(
Expand Down
2 changes: 1 addition & 1 deletion pandas/core/internals/managers.py
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@ def __len__(self) -> int:
return len(self.items)

def __repr__(self) -> str:
output = pprint_thing(type(self).__name__)
output = type(self).__name__
for i, ax in enumerate(self.axes):
if i == 0:
output += "\nItems: {ax}".format(ax=ax)
Expand Down
7 changes: 3 additions & 4 deletions pandas/core/series.py
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ def __init__(
elif is_extension_array_dtype(data):
pass
elif isinstance(data, (set, frozenset)):
raise TypeError("{0!r} type is unordered".format(type(data).__name__))
raise TypeError(f"{repr(type(data).__name__)} type is unordered")
elif isinstance(data, ABCSparseArray):
# handle sparse passed here (and force conversion)
data = data.to_dense()
Expand Down Expand Up @@ -1569,9 +1569,8 @@ def to_string(
# catch contract violations
if not isinstance(result, str):
raise AssertionError(
"result must be of type unicode, type"
" of result is {0!r}"
"".format(type(result).__name__)
"result must be of type str, type"
f" of result is {repr(type(result).__name__)}"
)

if buf is None:
Expand Down

0 comments on commit 5a0b4bc

Please sign in to comment.