diff --git a/pandas/tests/groupby/test_reductions.py b/pandas/tests/groupby/test_reductions.py index ad5d81096909a..425079f943aba 100644 --- a/pandas/tests/groupby/test_reductions.py +++ b/pandas/tests/groupby/test_reductions.py @@ -1059,25 +1059,25 @@ def test_regression_allowlist_methods(op, axis, skipna, sort): tm.assert_frame_equal(result, expected) -def test_prod_groupby_consistency_values(): +def test_groupby_prod_with_int64_dtype(): # GH#46573 data = [ - [1, 10], - [1, 21], - [1, 32], - [1, 43], - [1, 54], - [1, 67], - [1, 78], - [1, 89], - [1, 5], + [1, 11], + [1, 41], [1, 17], [1, 37], + [1, 7], + [1, 29], + [1, 31], + [1, 2], + [1, 3], + [1, 43], + [1, 5], [1, 47], - [1, 99], - [1, 101], + [1, 19], + [1, 88], ] - df = DataFrame(data, columns=["A", "B"]) + df = DataFrame(data, columns=["A", "B"], dtype="int64") result = df.groupby(["A"]).prod().reset_index() - expected = DataFrame([df.prod()], columns=df.columns) + expected = DataFrame({"A": [1], "B": [180970905912331920]}, dtype="int64") tm.assert_frame_equal(result, expected)