Skip to content

Commit

Permalink
pandas-dev#29886 - Replace !r for repr() on pandas/io/parses.py (pand…
Browse files Browse the repository at this point in the history
  • Loading branch information
JvPy authored and proost committed Dec 19, 2019
1 parent 1ba91b3 commit 64592a7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
4 changes: 1 addition & 3 deletions pandas/io/html.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,9 +102,7 @@ def _get_skiprows(skiprows):
return skiprows
elif skiprows is None:
return 0
raise TypeError(
f"'{type(skiprows).__name__}' is not a valid type for skipping rows"
)
raise TypeError(f"{type(skiprows).__name__} is not a valid type for skipping rows")


def _read(obj):
Expand Down
10 changes: 5 additions & 5 deletions pandas/io/parsers.py
Original file line number Diff line number Diff line change
Expand Up @@ -913,8 +913,8 @@ def _get_options_with_defaults(self, engine):
pass
else:
raise ValueError(
"The %r option is not supported with the"
" %r engine" % (argname, engine)
f"The {repr(argname)} option is not supported with the"
f" {repr(engine)} engine"
)
else:
value = _deprecated_defaults.get(argname, default)
Expand Down Expand Up @@ -1079,8 +1079,8 @@ def _clean_options(self, options, engine):
if converters is not None:
if not isinstance(converters, dict):
raise TypeError(
f"Type converters must be a dict or subclass, "
f"input was a {repr(type(converters).__name__)}"
"Type converters must be a dict or subclass, "
f"input was a {type(converters).__name__}"
)
else:
converters = {}
Expand Down Expand Up @@ -3608,7 +3608,7 @@ def __init__(self, f, colspecs, delimiter, comment, skiprows=None, infer_nrows=1
if not isinstance(self.colspecs, (tuple, list)):
raise TypeError(
"column specifications must be a list or tuple, "
"input was a %r" % type(colspecs).__name__
f"input was a {type(colspecs).__name__}"
)

for colspec in self.colspecs:
Expand Down

0 comments on commit 64592a7

Please sign in to comment.