Skip to content

Commit b164624

Browse files
JvPyjreback
authored andcommitted
#29886 - Replace !r for repr() on pandas/io/parses.py (#30073)
1 parent d1bc773 commit b164624

File tree

2 files changed

+6
-8
lines changed

2 files changed

+6
-8
lines changed

pandas/io/html.py

+1-3
Original file line numberDiff line numberDiff line change
@@ -102,9 +102,7 @@ def _get_skiprows(skiprows):
102102
return skiprows
103103
elif skiprows is None:
104104
return 0
105-
raise TypeError(
106-
f"'{type(skiprows).__name__}' is not a valid type for skipping rows"
107-
)
105+
raise TypeError(f"{type(skiprows).__name__} is not a valid type for skipping rows")
108106

109107

110108
def _read(obj):

pandas/io/parsers.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -913,8 +913,8 @@ def _get_options_with_defaults(self, engine):
913913
pass
914914
else:
915915
raise ValueError(
916-
"The %r option is not supported with the"
917-
" %r engine" % (argname, engine)
916+
f"The {repr(argname)} option is not supported with the"
917+
f" {repr(engine)} engine"
918918
)
919919
else:
920920
value = _deprecated_defaults.get(argname, default)
@@ -1079,8 +1079,8 @@ def _clean_options(self, options, engine):
10791079
if converters is not None:
10801080
if not isinstance(converters, dict):
10811081
raise TypeError(
1082-
f"Type converters must be a dict or subclass, "
1083-
f"input was a {repr(type(converters).__name__)}"
1082+
"Type converters must be a dict or subclass, "
1083+
f"input was a {type(converters).__name__}"
10841084
)
10851085
else:
10861086
converters = {}
@@ -3608,7 +3608,7 @@ def __init__(self, f, colspecs, delimiter, comment, skiprows=None, infer_nrows=1
36083608
if not isinstance(self.colspecs, (tuple, list)):
36093609
raise TypeError(
36103610
"column specifications must be a list or tuple, "
3611-
"input was a %r" % type(colspecs).__name__
3611+
f"input was a {type(colspecs).__name__}"
36123612
)
36133613

36143614
for colspec in self.colspecs:

0 commit comments

Comments
 (0)