Skip to content

Commit 5045a99

Browse files
authored
DataFrame transform with fillna test GH#26840 (#52230)
Signed-off-by: Liang Yan <[email protected]>
1 parent a70a1f8 commit 5045a99

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

pandas/tests/groupby/transform/test_transform.py

+14
Original file line numberDiff line numberDiff line change
@@ -361,6 +361,20 @@ def test_dispatch_transform(tsframe):
361361
tm.assert_frame_equal(filled, expected)
362362

363363

364+
def test_transform_fillna_null():
365+
df = DataFrame(
366+
dict(
367+
price=[10, 10, 20, 20, 30, 30],
368+
color=[10, 10, 20, 20, 30, 30],
369+
cost=(100, 200, 300, 400, 500, 600),
370+
)
371+
)
372+
with pytest.raises(ValueError, match="Must specify a fill 'value' or 'method'"):
373+
df.groupby(["price"]).transform("fillna")
374+
with pytest.raises(ValueError, match="Must specify a fill 'value' or 'method'"):
375+
df.groupby(["price"]).fillna()
376+
377+
364378
def test_transform_transformation_func(transformation_func):
365379
# GH 30918
366380
df = DataFrame(

0 commit comments

Comments
 (0)