Skip to content

Commit ccf1bd2

Browse files
CI/DEP: Use numba.extending.is_jitted for numba version > 0.49.0 (pandas-dev#33994)
1 parent 5569126 commit ccf1bd2

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

pandas/core/window/numba_.py

+7-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
from distutils.version import LooseVersion
12
import types
23
from typing import Any, Callable, Dict, Optional, Tuple
34

@@ -42,7 +43,12 @@ def make_rolling_apply(
4243
else:
4344
loop_range = range
4445

45-
if isinstance(func, numba.targets.registry.CPUDispatcher):
46+
if LooseVersion(numba.__version__) >= LooseVersion("0.49.0"):
47+
is_jitted = numba.extending.is_jitted(func)
48+
else:
49+
is_jitted = isinstance(func, numba.targets.registry.CPUDispatcher)
50+
51+
if is_jitted:
4652
# Don't jit a user passed jitted function
4753
numba_func = func
4854
else:

0 commit comments

Comments
 (0)