diff --git a/pandas/tests/groupby/transform/test_transform.py b/pandas/tests/groupby/transform/test_transform.py index d7dc2d8937467..c1201c33123ab 100644 --- a/pandas/tests/groupby/transform/test_transform.py +++ b/pandas/tests/groupby/transform/test_transform.py @@ -361,6 +361,20 @@ def test_dispatch_transform(tsframe): tm.assert_frame_equal(filled, expected) +def test_transform_fillna_null(): + df = DataFrame( + dict( + price=[10, 10, 20, 20, 30, 30], + color=[10, 10, 20, 20, 30, 30], + cost=(100, 200, 300, 400, 500, 600), + ) + ) + with pytest.raises(ValueError, match="Must specify a fill 'value' or 'method'"): + df.groupby(["price"]).transform("fillna") + with pytest.raises(ValueError, match="Must specify a fill 'value' or 'method'"): + df.groupby(["price"]).fillna() + + def test_transform_transformation_func(transformation_func): # GH 30918 df = DataFrame(