From 193e4cecaeec1a37ac1e521937525c6832eda66a Mon Sep 17 00:00:00 2001 From: Debian Science Team Date: Fri, 9 Feb 2024 20:48:14 +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 c5792fa1..a25ab963 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 @@ -120,6 +123,8 @@ def import_optional_dependency( """ 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