From: Debian Science Team Date: Sun, 2 Feb 2025 11:17:13 +0000 (+0000) Subject: Warn that numba may not work on non-x86 X-Git-Tag: archive/raspbian/2.2.3+dfsg-7+rpi1~20 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=2172e81054892b330242b6298ba130f01fb5ae07;p=pandas.git 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 Forwarded: no Gbp-Pq: Name numba_warn_nonx86.patch --- diff --git a/pandas/compat/_optional.py b/pandas/compat/_optional.py index 2bc6cd46..46da243b 100644 --- a/pandas/compat/_optional.py +++ b/pandas/compat/_optional.py @@ -4,6 +4,9 @@ import importlib import sys from typing import TYPE_CHECKING import warnings +import platform +import re +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 from pandas.util._exceptions import find_stack_level @@ -123,6 +126,8 @@ def import_optional_dependency( is ``'warn'`` or ``'ignore'``. """ assert errors in {"warn", "raise", "ignore"} + if name=='numba' and warn_numba_platform: + warnings.warn(warn_numba_platform) package_name = INSTALL_MAPPING.get(name) install_name = package_name if package_name is not None else name