Skip to content

STYLE: fix pylint consider-iterating-dictionary warnings #49305

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 25, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pandas/core/groupby/generic.py
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ def _aggregate_multiple_funcs(self, arg) -> DataFrame:
from pandas import concat

res_df = concat(
results.values(), axis=1, keys=[key.label for key in results.keys()]
results.values(), axis=1, keys=[key.label for key in results]
)
return res_df

Expand Down
2 changes: 1 addition & 1 deletion pandas/io/clipboard/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -608,7 +608,7 @@ def set_clipboard(clipboard):
}

if clipboard not in clipboard_types:
allowed_clipboard_types = [repr(_) for _ in clipboard_types.keys()]
allowed_clipboard_types = [repr(_) for _ in clipboard_types]
raise ValueError(
f"Argument must be one of {', '.join(allowed_clipboard_types)}"
)
Expand Down
2 changes: 1 addition & 1 deletion pandas/io/formats/style_render.py
Original file line number Diff line number Diff line change
Expand Up @@ -2284,7 +2284,7 @@ def color(value, user_arg, command, comm_arg):
if isinstance(value, str) and "--latex" in value:
# return the style without conversion but drop '--latex'
latex_styles.append((attribute, value.replace("--latex", "")))
if attribute in CONVERTED_ATTRIBUTES.keys():
if attribute in CONVERTED_ATTRIBUTES:
arg = ""
for x in ["--wrap", "--nowrap", "--lwrap", "--dwrap", "--rwrap"]:
if x in str(value):
Expand Down
2 changes: 1 addition & 1 deletion pandas/tests/reshape/test_pivot.py
Original file line number Diff line number Diff line change
Expand Up @@ -1699,7 +1699,7 @@ def test_pivot_table_with_iterator_values(self, data):
)
tm.assert_frame_equal(pivot_values_keys, pivot_values_list)

agg_values_gen = (value for value in aggs.keys())
agg_values_gen = (value for value in aggs)
pivot_values_gen = pivot_table(
data, index=["A"], values=agg_values_gen, aggfunc=aggs
)
Expand Down
2 changes: 1 addition & 1 deletion pandas/tests/series/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ def test_unknown_attribute(self):
# GH#9680
tdi = pd.timedelta_range(start=0, periods=10, freq="1s")
ser = Series(np.random.normal(size=10), index=tdi)
assert "foo" not in ser.__dict__.keys()
assert "foo" not in ser.__dict__
msg = "'Series' object has no attribute 'foo'"
with pytest.raises(AttributeError, match=msg):
ser.foo
Expand Down
1 change: 0 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,6 @@ disable = [
"used-before-assignment",

# pylint type "C": convention, for programming standard violation
"consider-iterating-dictionary",
"consider-using-f-string",
"disallowed-name",
"import-outside-toplevel",
Expand Down