From 2172e81054892b330242b6298ba130f01fb5ae07 Mon Sep 17 00:00:00 2001 From: Debian Science Team Date: Sun, 2 Feb 2025 11:17:13 +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