Repository navigation
Description
Is there an existing issue for the same bug?
- Checked existing issues; no matching concrete NumPy/PyArrow installation failure was found.
- Related PR: feat(python-sdk): add managed file queries and Arrow analytics #30054 (
cb9882384067b077dd8160c8c63e74176174061d), which introduced the analytics extra. - Related tracker: [Enhancement]: Unify Python SDK parameter, result and optional-dependency contracts #30069. That enhancement tracks broader dependency qualification; this report supplies a reproducible, accepted-but-unusable dependency combination.
Branch Name
main
Commit ID
802376360c574f44aea23db5eef3cfcebf0527fd
Other Environment Information
- Linux amd64, Python 3.11.2.
- SDK 0.1.16, built from the commit above.
- NumPy 1.24.2, PyArrow 26.0.0.
- Reproduced in a fresh virtual environment without system-site-packages, using an ordinary installation of the analytics extra. No
--no-deps, import mocks, or dependency constraint overrides were used. - No MatrixOne server is needed: the failure occurs before connection or SQL execution.
Actual Behavior
An environment with NumPy 1.24.2 can successfully install matrixone-python-sdk[analytics]. The resolver accepts the existing NumPy and installs PyArrow 26.0.0, but the public analytics entry point fails immediately:
ImportError: Install matrixone-python-sdk[analytics] to use Arrow analytics
The above exception was caused by:
ImportError: pyarrow requires NumPy 2.0 or newer, found 1.24.2
The suggested extra is already installed. Reinstalling it with the same accepted versions does not make the feature usable. All analytics queries hit _arrow() before accessing the engine, so connecting the client cannot bypass this dependency failure.
Suggested priority: P2 — analytics initialization is unavailable for this validly resolved installation. This reproduction does not show a kernel failure or data corruption.
Expected Behavior
Installing the analytics extra should resolve dependencies that can initialize together, including when an older NumPy satisfying the SDK's declared minimum is already installed. Incompatible installed dependencies should also produce a diagnostic that distinguishes incompatibility from a missing extra.
Steps to Reproduce
git clone https://github.com/matrixorigin/matrixone.git matrixone-analytics-repro
cd matrixone-analytics-repro
git checkout --detach 802376360c574f44aea23db5eef3cfcebf0527fd
python3.11 -m venv .venv-repro
.venv-repro/bin/python -m pip install numpy==1.24.2
.venv-repro/bin/python -m pip install './clients/python[analytics]'
.venv-repro/bin/python - <<'PY'
from importlib.metadata import version
from matrixone import Client
for package in ('matrixone-python-sdk', 'numpy', 'pyarrow'):
print(package, version(package))
# No connection is opened: dependency initialization happens first.
Client().analytics.query('SELECT 1')
PYObserved: both installation commands exit successfully; installed versions are SDK 0.1.16, NumPy 1.24.2 and PyArrow 26.0.0; the public call raises the exception chain above. For deterministic reproduction after newer PyArrow releases, install pyarrow==26.0.0 before the SDK installation. This combination still satisfies the SDK's published constraints.
Root Cause
The SDK declares numpy>=1.20.0 and the analytics extra declares only pyarrow>=18.0.0. Both reproduced versions satisfy these constraints. The installed PyArrow 26.0.0 distribution reports no Requires-Dist entries, so pip does not learn its runtime NumPy requirement and retains NumPy 1.24.2.
_arrow() catches that import incompatibility and replaces the top-level diagnostic with an instruction to install the already-installed extra. AnalyticsManager.query() invokes this helper before touching the engine.
git blame attributes the analytics dependency declaration to #30054. The parent commit did not have this new feature; no claim is made that the same API passed on the parent.
Validation and Version Control
| SDK / NumPy | PyArrow | Result |
|---|---|---|
| Same frozen SDK / 1.24.2 | 26.0.0 | Plain PyArrow import and public analytics.query() fail with the NumPy requirement above |
| Same frozen SDK / 1.24.2 | 18.1.0 | Import succeeds; the public call passes dependency initialization and reaches the expected RuntimeError: Connect the MatrixOne client first |
The version control changed only PyArrow through an isolated dependency directory, preserving SDK code, NumPy and Python. Six existing pure-local SDK ArrowStream TIME conversion/lossy-cast rejection tests also passed with PyArrow 18.1.0. This control does not claim SQL execution or a real-server integration pass.
The failure was independently rerun directly against the installed wheel, without first importing PyArrow or importing SDK source through PYTHONPATH; the installed analytics.py bytes matched the frozen source.
Suggested Fix
Declare compatible NumPy/PyArrow combinations for the analytics extra, or bound PyArrow to a verified compatible range. Add an installation test starting with an existing older NumPy, and preserve a useful incompatibility diagnostic. PyArrow 18.1.0 was a working control here; other version boundaries were not established by this experiment.
Activity
fix(python): unify SDK query and analytics lifecycle contracts (#31774)
XuPeng-SH commentedon Oct 30, 2026
QA handoff for merged #31774 (main
bbfe55669a1440424914d45a283a1d0e36f722fa): please verify the reported public SDK contract and its failure/recovery controls for analytics extra accepts NumPy 1.24 + PyArrow 26 but fails at initialization. This isolated QA run inspected the issue and merged PR but did not run tests or a live MatrixOne service at this SHA because the existing resource guard left insufficient headroom. The PR's author-reported validation is separate evidence, not a result of this QA run.Ariznawlll commentedon Oct 30, 2026
结论
测试不通过。analytics extra 的正常安装依赖解析已修正,但 issue 要求的“不兼容依赖与未安装 extra 的诊断区分”仍未满足。
关键证据
main@d39d8a40343ccd40bf665036388df7a40ee867f8;修复 PR fix(python): unify SDK query and analytics lifecycle contracts #31774 的合并提交bbfe55669a1440424914d45a283a1d0e36f722fa在祖先链。隔离 macOS arm64、Python 3.11;此问题发生在连接服务前,无数据库部署。Client().analytics.query('SELECT 1')均越过依赖初始化,返回预期的未连接 RuntimeError,3/3。--no-deps人工保留 PyArrow 26.0.0 并降级 NumPy 至 1.24.2,明确构造不满足当前包依赖约束的异常环境,不是正常解析结果。调用公开 analytics 接口 3/3 顶层仍提示安装已经安装的matrixone-python-sdk[analytics];异常链的 cause 才显示 PyArrow 要求 NumPy 2.0 或更高。issue 的预期明确要求诊断区分不兼容依赖和未安装 extra,该部分仍未改善。待解决点
fix(python): restore SDK SQL and execution contracts (#31953)
XuPeng-SH commentedon Oct 31, 2026
新修复转 QA:#31953 已合入 main,merge SHA
569d521cfae73ba80c42f58366c172ce4ef84ed7。此前正常 analytics extra 解析已通过;本次区分缺失 PyArrow 与已安装依赖内部 ImportError,保留 cause。请验证缺少 extra、不兼容依赖、正常安装及 core-only 导入;Linux amd64、已连接 Arrow SQL 与完整依赖矩阵仍需 QA。
验证证据:作者记录离线多 SQLAlchemy 矩阵、187 个 native 合同、19 个全文 SQL 检查;当前 head 独立 reviewer 记录 315 个 focused Python tests、11 个 SDK online cases 及三个 Go owner package 通过。上述均为 PR 作者/评审者报告,不是本轮独立本地实测。本轮读取 issue 完整评论、修复范围及远端合并状态,未运行服务或测试;未发现适用于新合并版本的已验证反例或未完成的开发 follow-up。转 @Ariznawlll 继续验证,不代表验收通过。完整 BVT、多 CN、长稳和生产环境验证不在本轮证据范围内。
Ariznawlll commentedon Nov 2, 2026
结论
测试通过。analytics extra 的正常安装能解析到可初始化的依赖;缺少 extra 和已安装但不兼容的依赖会给出不同诊断。
关键证据
main@35202093259793e48dcd7abc8ff418f07190f746,修复 fix(python): restore SDK SQL and execution contracts #31953 的 merge569d521cfae73ba80c42f58366c172ce4ef84ed7在祖先链。原故障发生于 SDK 初始化、连接数据库之前,本轮不需要服务端。Client().analytics.query('SELECT 1')均越过 Arrow 初始化,达到预期的“客户端未连接”错误,重复 3/3。macOS arm64 / Python 3.11 也按相同旧依赖起点重复解析并检查 3/3。--no-deps人为保留不满足新依赖约束的 NumPy 1.24.2 / PyArrow 26.0.0,公开入口 3/3 显示依赖不兼容和 NumPy 版本要求,原始 ImportError 保留为 cause;这不是正常依赖解析会得到的组合。实际未安装 PyArrow 的 macOS core-only 环境提示安装 analytics extra,3/3。SDK 定向测试分别用 SQLAlchemy 1.4.54 / 2.1.6 各重复 3 轮,覆盖缺失 extra 与内部 ImportError 的区分。待解决点