Skip to content

Commit 362f348

Browse files
authored
STYLE: Enable Pylint warning redundant-keyword-arg (#50086)
* Enable the Pylint warning redundant-keyword-arg and relocate a suppression statement. * Remove unnecessary pylint disable statements
1 parent d660831 commit 362f348

File tree

5 files changed

+5
-7
lines changed

5 files changed

+5
-7
lines changed

pandas/_testing/_io.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ def wrapper(*args, **kwargs):
225225
)
226226
try:
227227
return t(*args, **kwargs)
228-
except Exception as err: # pylint: disable=broad-except
228+
except Exception as err:
229229
errno = getattr(err, "errno", None)
230230
if not errno and hasattr(errno, "reason"):
231231
# error: "Exception" has no attribute "reason"

pandas/core/dtypes/cast.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -485,7 +485,7 @@ def maybe_cast_to_extension_array(
485485

486486
try:
487487
result = cls._from_sequence(obj, dtype=dtype)
488-
except Exception: # pylint: disable=broad-except
488+
except Exception:
489489
# We can't predict what downstream EA constructors may raise
490490
result = obj
491491
return result

pandas/tests/frame/methods/test_rename.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,7 @@ def test_rename_axis_style_raises(self):
334334

335335
# Duplicates
336336
with pytest.raises(TypeError, match="multiple values"):
337-
df.rename(id, mapper=id) # pylint: disable=redundant-keyword-arg
337+
df.rename(id, mapper=id)
338338

339339
def test_rename_positional_raises(self):
340340
# GH 29136

pandas/tests/io/test_html.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1113,9 +1113,8 @@ def test_works_on_valid_markup(self, datapath):
11131113
@pytest.mark.slow
11141114
def test_fallback_success(self, datapath):
11151115
banklist_data = datapath("io", "data", "html", "banklist.html")
1116-
self.read_html(
1117-
banklist_data, match=".*Water.*", flavor=["lxml", "html5lib"]
1118-
) # pylint: disable=redundant-keyword-arg
1116+
1117+
self.read_html(banklist_data, match=".*Water.*", flavor=["lxml", "html5lib"])
11191118

11201119
def test_to_html_timestamp(self):
11211120
rng = date_range("2000-01-01", periods=10)

pyproject.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,6 @@ disable = [
230230

231231
# misc
232232
"abstract-class-instantiated",
233-
"redundant-keyword-arg",
234233
"no-value-for-parameter",
235234
"undefined-variable",
236235
"unpacking-non-sequence",

0 commit comments

Comments
 (0)