From ecddb24ef129d5392a5036e6e8eff2694bd22fc3 Mon Sep 17 00:00:00 2001 From: Debian Science Team Date: Tue, 28 Jan 2025 22:18:06 +0000 Subject: [PATCH] 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 --- pandas/compat/_optional.py | 5 +++++ 1 file changed, 5 insertions(+) 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 -- 2.30.2