Skip to content

Commit 208d2fc

Browse files
committed
Code style chore (Pre-commit hook)
1 parent 14de84b commit 208d2fc

File tree

1 file changed

+19
-13
lines changed

1 file changed

+19
-13
lines changed

pandas/tests/groupby/test_groupby.py

Lines changed: 19 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3004,31 +3004,37 @@ def test_groupby_agg_namedagg_with_duplicate_columns():
30043004

30053005
tm.assert_frame_equal(result, expected)
30063006

3007+
30073008
class MyDataFrame(DataFrame):
30083009
@property
30093010
def _constructor(self):
30103011
return MyDataFrame
30113012

3012-
@pytest.mark.parametrize("data, agg_dict, expected", [
3013-
pytest.param(
3014-
{"A": [1, 1, 2, 2], "B": [1, 2, 3, 4]},
3015-
{"B": "sum"},
3016-
DataFrame({"B": [3, 7]}, index=Index([1, 2], name="A"))
3017-
),
3018-
pytest.param(
3019-
{"A": [1, 1, 2, 2], "B": [1, 2, 3, 4], "C": [4, 3, 2, 1]},
3020-
{"B": "sum", "C": "mean"},
3021-
DataFrame({"B": [3, 7], "C": [3.5, 1.5]}, index=Index([1, 2], name="A"))
3022-
),
3023-
])
3013+
3014+
@pytest.mark.parametrize(
3015+
"data, agg_dict, expected",
3016+
[
3017+
pytest.param(
3018+
{"A": [1, 1, 2, 2], "B": [1, 2, 3, 4]},
3019+
{"B": "sum"},
3020+
DataFrame({"B": [3, 7]}, index=Index([1, 2], name="A")),
3021+
),
3022+
pytest.param(
3023+
{"A": [1, 1, 2, 2], "B": [1, 2, 3, 4], "C": [4, 3, 2, 1]},
3024+
{"B": "sum", "C": "mean"},
3025+
DataFrame({"B": [3, 7], "C": [3.5, 1.5]}, index=Index([1, 2], name="A")),
3026+
),
3027+
],
3028+
)
30243029
def test_groupby_agg_preserves_subclass(data, agg_dict, expected):
30253030
# GH#59667
30263031
df = MyDataFrame(data)
30273032
result = df.groupby("A").agg(agg_dict)
3028-
3033+
30293034
assert isinstance(result, MyDataFrame)
30303035
tm.assert_frame_equal(result, expected)
30313036

3037+
30323038
def test_groupby_multi_index_codes():
30333039
# GH#54347
30343040
df = DataFrame(

0 commit comments

Comments
 (0)