You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Linux, Python 3.12.14, SQLAlchemy 2.0.55. This reproduces before any database connection.
Actual Behavior
An invalid MATRIXONE_PORT or MATRIXONE_CONNECT_TIMEOUT is converted with int() before explicit keyword overrides are applied. A valid explicit override therefore still raises ValueError.
Expected Behavior
The documented order is explicit parameters > environment > defaults. An overridden environment value must not be parsed. Invalid environment values without an override must still be rejected.
Actual: ValueError: invalid literal for int() with base 10: 'invalid'
Expected: configuration with port=6002. The timeout field fails in the same way.
Additional information
Fix: skip environment lookup for keys present in explicit overrides, retaining the existing final update and conversion behavior for remaining fields.
Regression: 5 failed / 3 passed before the fix; all 8 pass afterward. Public config, connection kwargs and tuple outputs are covered, including zero/false/empty values and invalid unoverridden settings.
Complete offline SDK suite: 1962 passed plus 95 subtests. CI fatal flake8 selection, new-test lint and git diff --check pass. Two files, +79 lines, of which two are production lines.
No live SQL BVT is needed for this local configuration-selection contract: the operation ends at a configuration dictionary/tuple and no transport, SQL, server or persistence behavior changes. Hosted CI is not yet verified.
QA on merged SDK source baa83f4b96e56ec214f92c68f7b56539b9e0fa45: the complete offline suite passed (2,279 tests plus 95 subtests) with Python 3.12.14 / SQLAlchemy 2.0.55. Its eight test_config_precedence.py cases verify explicit port/timeout overrides against invalid environment values, zero and connection outputs, rejection of unoverridden invalid values, and environment/default controls. This covers the reported local configuration-selection contract; no server is required for that contract. Hosted CI was not verified by this run. Assignment remains unchanged pending handoff.
Activity
fix(python): unify SDK execution contracts across 4.1.x and 4.2.x (#3…
XuPeng-SH commentedon Oct 27, 2026
QA on merged SDK source
baa83f4b96e56ec214f92c68f7b56539b9e0fa45: the complete offline suite passed (2,279 tests plus 95 subtests) with Python 3.12.14 / SQLAlchemy 2.0.55. Its eighttest_config_precedence.pycases verify explicit port/timeout overrides against invalid environment values, zero and connection outputs, rejection of unoverridden invalid values, and environment/default controls. This covers the reported local configuration-selection contract; no server is required for that contract. Hosted CI was not verified by this run. Assignment remains unchanged pending handoff.Ariznawlll commentedon Oct 27, 2026
测试版本
main:d4ffbae43d55da21526eab01722cbef14bb01ed5;修复 PR #31322 的 merge commitbaa83f4b96e56ec214f92c68f7b56539b9e0fa45在该提交祖先链中。原问题验证
分别把端口及连接超时环境值设置为非法字符串,同时显式传入端口 6002、超时 7;公开配置入口实际返回 6002 和 7,不会解析被覆盖的非法值。定向 SDK 测试与 MOTR 场景各独立重复 3 次,均通过。
Happy Path 覆盖
验证
get_config、get_connection_kwargs、get_client_kwargs及 tuple 入口;正常环境值被转换,显式0、False、空字符串与None按提供值处理,未覆盖字段仍按环境或默认值解析。配置输出隐藏密码,默认配置不因调用而改变。Unhappy Path 覆盖
端口或超时没有显式覆盖且环境值非法时仍抛出
ValueError;验证未选择的无效环境项不会被读取。测试后恢复进程环境变量。白盒验证
本问题为 Python 配置选择,未涉及 Go 路径,无 Go race;独立运行
tests/offline/contracts/test_config_result_boundaries.py和全文分页参数化测试,合计 58 项,3 轮均通过。回归测试
MOTR #284 增加 SDK 公共入口场景;该场景与相邻 #30824 用例各运行 3 次、均通过。未运行完整 MOTR 套件。
测试证据
修复 PR 的 Python SDK 离线 CI 矩阵通过,online job 标记 skipped;MOTR 新 head 的四项托管离线检查通过,不把离线检查等同完整在线 CI。
测试结论
测试通过。