1
1
import pytest
2
2
3
+ from pandas .errors import NumbaUtilError
3
4
import pandas .util ._test_decorators as td
4
5
5
6
from pandas import DataFrame
@@ -16,10 +17,10 @@ def incorrect_function(x):
16
17
{"key" : ["a" , "a" , "b" , "b" , "a" ], "data" : [1.0 , 2.0 , 3.0 , 4.0 , 5.0 ]},
17
18
columns = ["key" , "data" ],
18
19
)
19
- with pytest .raises (ValueError , match = f"The first 2" ):
20
+ with pytest .raises (NumbaUtilError , match = f"The first 2" ):
20
21
data .groupby ("key" ).transform (incorrect_function , engine = "numba" )
21
22
22
- with pytest .raises (ValueError , match = f"The first 2" ):
23
+ with pytest .raises (NumbaUtilError , match = f"The first 2" ):
23
24
data .groupby ("key" )["data" ].transform (incorrect_function , engine = "numba" )
24
25
25
26
@@ -32,10 +33,10 @@ def incorrect_function(x, **kwargs):
32
33
{"key" : ["a" , "a" , "b" , "b" , "a" ], "data" : [1.0 , 2.0 , 3.0 , 4.0 , 5.0 ]},
33
34
columns = ["key" , "data" ],
34
35
)
35
- with pytest .raises (ValueError , match = "numba does not support" ):
36
+ with pytest .raises (NumbaUtilError , match = "numba does not support" ):
36
37
data .groupby ("key" ).transform (incorrect_function , engine = "numba" , a = 1 )
37
38
38
- with pytest .raises (ValueError , match = "numba does not support" ):
39
+ with pytest .raises (NumbaUtilError , match = "numba does not support" ):
39
40
data .groupby ("key" )["data" ].transform (incorrect_function , engine = "numba" , a = 1 )
40
41
41
42
0 commit comments