Skip to content

Commit 5831cd5

Browse files
committed
fixup! STYLE: fix pylint unnecessary-comprehension warnings
1 parent 3853b0b commit 5831cd5

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

pandas/tests/groupby/test_grouping.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -946,7 +946,11 @@ def test_multi_iter_frame(self, three_group):
946946
df["k1"] = np.array(["b", "b", "b", "a", "a", "a"])
947947
df["k2"] = np.array(["1", "1", "1", "2", "2", "2"])
948948
grouped = df.groupby(["k1", "k2"])
949-
groups = dict(grouped)
949+
# calling `dict` on a DataFrameGroupBy leads to a TypeError,
950+
# we need to use a dictionary comprehension here
951+
groups = {
952+
key: gp for key, gp in grouped
953+
} # pylint: disable=unnecessary-comprehension
950954
assert len(groups) == 2
951955

952956
# axis = 1

0 commit comments

Comments
 (0)