Skip to content

Commit e0d4622

Browse files
mroeschkeMatt Roeschke
and
Matt Roeschke
authored
Use numba.extending.is_jitted for numba version > 0.50 (#33687)
Co-authored-by: Matt Roeschke <[email protected]>
1 parent ed15d8e commit e0d4622

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

pandas/core/util/numba_.py

+7-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""Common utilities for Numba operations"""
2+
from distutils.version import LooseVersion
23
import inspect
34
import types
45
from typing import Callable, Dict, Optional, Tuple
@@ -90,7 +91,12 @@ def jit_user_function(
9091
"""
9192
numba = import_optional_dependency("numba")
9293

93-
if isinstance(func, numba.targets.registry.CPUDispatcher):
94+
if LooseVersion(numba.__version__) >= LooseVersion("0.49.0"):
95+
is_jitted = numba.extending.is_jitted(func)
96+
else:
97+
is_jitted = isinstance(func, numba.targets.registry.CPUDispatcher)
98+
99+
if is_jitted:
94100
# Don't jit a user passed jitted function
95101
numba_func = func
96102
else:

0 commit comments

Comments
 (0)