Skip to content

Commit ac09926

Browse files
Debian Science Teamrebecca-palmer
authored andcommitted
Warn that numba may not work on non-x86
Currently known issues are crashes, not wrong answers, but because the test setup doesn't allow ignoring crashes but failing on wrong answers, it would be easy to not notice if this changed Author: Rebecca N. Palmer <[email protected]> Forwarded: no Gbp-Pq: Name numba_warn_nonx86.patch
1 parent 9b63b98 commit ac09926

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

pandas/compat/_optional.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44
import sys
55
from typing import TYPE_CHECKING
66
import warnings
7+
import platform
8+
import re
9+
warn_numba_platform = "Non-x86 system detected, Numba may give wrong results or crash" if not bool(re.match('i.?86|x86',platform.uname()[4])) else False
710

811
from pandas.util._exceptions import find_stack_level
912

@@ -123,6 +126,8 @@ def import_optional_dependency(
123126
is ``'warn'`` or ``'ignore'``.
124127
"""
125128
assert errors in {"warn", "raise", "ignore"}
129+
if name=='numba' and warn_numba_platform:
130+
warnings.warn(warn_numba_platform)
126131

127132
package_name = INSTALL_MAPPING.get(name)
128133
install_name = package_name if package_name is not None else name

0 commit comments

Comments
 (0)