Skip to content

Commit ae60654

Browse files
committed
Use GLOBAL_USE_NUMBA from core/utils/numba_ to control switch in nanops.py
1 parent 36afc0f commit ae60654

File tree

1 file changed

+3
-13
lines changed

1 file changed

+3
-13
lines changed

pandas/core/nanops.py

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,8 @@
4848
notna,
4949
)
5050

51+
52+
from pandas.core.util.numba_ import GLOBAL_USE_NUMBA
5153
from pandas.core import nanops_numba
5254

5355
if TYPE_CHECKING:
@@ -68,18 +70,6 @@ def set_use_bottleneck(v: bool = True) -> None:
6870
set_use_bottleneck(get_option("compute.use_bottleneck"))
6971

7072

71-
_USE_NUMBA = True
72-
73-
74-
def set_use_numba(v: bool = True) -> None:
75-
# set/unset to use bottleneck
76-
global _USE_NUMBA
77-
_USE_NUMBA = v
78-
79-
80-
# set_use_numba(get_option("compute.use_numba"))
81-
82-
8373
class disallow:
8474
def __init__(self, *dtypes: Dtype) -> None:
8575
super().__init__()
@@ -133,7 +123,7 @@ def f(
133123
**kwds,
134124
):
135125
disallowed = values.dtype == "O"
136-
if _USE_NUMBA and not disallowed:
126+
if GLOBAL_USE_NUMBA and not disallowed:
137127
result = nb_func(values, skipna=skipna, axis=axis, **kwds)
138128
else:
139129
result = alt(values, axis=axis, skipna=skipna, **kwds)

0 commit comments

Comments
 (0)