Skip to content

Commit

Permalink
CLN remove unnecessary trailing commas in groupby tests
Browse files Browse the repository at this point in the history
  • Loading branch information
xcz011 committed Sep 2, 2020
1 parent 0bc407a commit e88ae97
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 12 deletions.
4 changes: 1 addition & 3 deletions pandas/tests/groupby/test_apply.py
Original file line number Diff line number Diff line change
Expand Up @@ -946,9 +946,7 @@ def fct(group):
tm.assert_series_equal(result, expected)


@pytest.mark.parametrize(
"function", [lambda gr: gr.index, lambda gr: gr.index + 1 - 1],
)
@pytest.mark.parametrize("function", [lambda gr: gr.index, lambda gr: gr.index + 1 - 1])
def test_apply_function_index_return(function):
# GH: 22541
df = pd.DataFrame([1, 2, 2, 2, 1, 2, 3, 1, 3, 1], columns=["id"])
Expand Down
2 changes: 1 addition & 1 deletion pandas/tests/groupby/test_categorical.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@


def cartesian_product_for_groupers(result, args, names, fill_value=np.NaN):
""" Reindex to a cartesian production for the groupers,
"""Reindex to a cartesian production for the groupers,
preserving the nature (Categorical) of each grouper
"""

Expand Down
4 changes: 1 addition & 3 deletions pandas/tests/groupby/test_groupby_dropna.py
Original file line number Diff line number Diff line change
Expand Up @@ -246,9 +246,7 @@ def test_groupby_dropna_multi_index_dataframe_agg(dropna, tuples, outputs):
(pd.Period("2020-01-01"), pd.Period("2020-02-01")),
],
)
@pytest.mark.parametrize(
"dropna, values", [(True, [12, 3]), (False, [12, 3, 6],)],
)
@pytest.mark.parametrize("dropna, values", [(True, [12, 3]), (False, [12, 3, 6])])
def test_groupby_dropna_datetime_like_data(
dropna, values, datetime1, datetime2, unique_nulls_fixture, unique_nulls_fixture2
):
Expand Down
4 changes: 1 addition & 3 deletions pandas/tests/groupby/test_groupby_subclass.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,7 @@ def test_groupby_preserves_subclass(obj, groupby_func):
tm.assert_series_equal(result1, result2)


@pytest.mark.parametrize(
"obj", [DataFrame, tm.SubclassedDataFrame],
)
@pytest.mark.parametrize("obj", [DataFrame, tm.SubclassedDataFrame])
def test_groupby_resample_preserves_subclass(obj):
# GH28330 -- preserve subclass through groupby.resample()

Expand Down
2 changes: 1 addition & 1 deletion pandas/tests/groupby/test_size.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def test_size_on_categorical(as_index):
result = df.groupby(["A", "B"], as_index=as_index).size()

expected = DataFrame(
[[1, 1, 1], [1, 2, 0], [2, 1, 0], [2, 2, 1]], columns=["A", "B", "size"],
[[1, 1, 1], [1, 2, 0], [2, 1, 0], [2, 2, 1]], columns=["A", "B", "size"]
)
expected["A"] = expected["A"].astype("category")
if as_index:
Expand Down
2 changes: 1 addition & 1 deletion pandas/tests/groupby/test_timegrouper.py
Original file line number Diff line number Diff line change
Expand Up @@ -780,6 +780,6 @@ def test_grouper_period_index(self):
result = period_series.groupby(period_series.index.month).sum()

expected = pd.Series(
range(0, periods), index=Index(range(1, periods + 1), name=index.name),
range(0, periods), index=Index(range(1, periods + 1), name=index.name)
)
tm.assert_series_equal(result, expected)

0 comments on commit e88ae97

Please sign in to comment.