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
{{ message }}
Repository navigation
[Bug]: Python SDK cannot clear a stage comment #30964
Offline reproduction against the exact current-main blobs for stage.py and test_stage_sql.py.
Actual Behavior
StageManager.alter(name, comment='') and AsyncStageManager.alter(name, comment='') raise ValueError before sending SQL. The shared _prepare_alter() validator uses truthiness for comment, even though the SQL builder accepts an empty string and MatrixOne supports ALTER STAGE ... SET COMMENT=''.
This prevents SDK users from clearing an existing stage comment.
Expected Behavior
An explicitly supplied empty comment should generate ALTER STAGE <name> SET COMMENT=''. Calls with no option, an empty URL, or empty credentials should retain their existing validation errors.
Steps to Reproduce
manager.alter('my_stage', comment='')
# ValueError: At least one of url, credentials, comment, or enable must be provided
The same failure occurs through AsyncStageManager.alter().
Additional information
The defect is in the shared sync/async validation boundary. A minimal fix changes only the comment presence check to comment is not None and adds public-path sync/async regressions plus negative controls.
QA follow-up for PR #30965 at head 9eddc6b4680fae09a119c967ad5499814aaa89f3: the formal approval review reports the sync/async empty-comment regressions and negative controls passing across its offline CI matrix, with supplemental mocked-executor scenarios and source tracing. This supports the validator fix for the reported bug. The workspace here has no MatrixOne checkout, and no live service or persistence test was run in this QA pass; please retain live stage-comment persistence as a follow-up verification. Handing the still-open issue to Ariznawlll for that verification.
Additional live QA evidence for merged PR #30965 is now complete.
Tested SDK source: pinned latest main 0abc1d317aea608f3a228297d68e1ae4e619a3a2; the changed clients/python/matrixone/stage.py blob is 1a89e7a327a41b9d3a04be40714c1d15a81e222c at both merge 8111f870f5d8cee40c53fc48bcbcde8292da1fa5 and pinned main.
Exact pre-merge package from first parent f8c872001603fed3d23784e1ada26f9a2d8f4fba reproduced the bug through both public sync and async alter(comment=''): each raised ValueError, and a second SQL session still read the prior comment.
With pinned-main SDK source, both public sync and async paths emitted ALTER STAGE <name> SET COMMENT=''; metadata read through independent sessions returned an empty comment. Negative controls for no options, url='', and credentials={} still raised ValueError, executed zero SQL statements, and preserved the existing comment; a valid clear succeeded after each sequence.
Both test stages and fresh per-run databases were dropped and verified absent.
This used the owned local service at 127.0.0.1:60220, version 8.0.30-MatrixOne-v1.3.0, binary source 6f773c556d4f3177f5373eb193cd576e080b662f (SHA-256 51489b59a60310e79eddcf1182c582685b2c60f800f35a0a625eb5359469349b). No service build was performed; this is a Python SDK change validated against the existing local backend. The issue-specific live behavior and negative controls passed. Existing Ariznawlll assignment was already in place and was left unchanged.
Activity
XuPeng-SH commentedon Oct 23, 2026
QA follow-up for PR #30965 at head
9eddc6b4680fae09a119c967ad5499814aaa89f3: the formal approval review reports the sync/async empty-comment regressions and negative controls passing across its offline CI matrix, with supplemental mocked-executor scenarios and source tracing. This supports the validator fix for the reported bug. The workspace here has no MatrixOne checkout, and no live service or persistence test was run in this QA pass; please retain live stage-comment persistence as a follow-up verification. Handing the still-open issue to Ariznawlll for that verification.XuPeng-SH commentedon Oct 24, 2026
Additional live QA evidence for merged PR #30965 is now complete.
0abc1d317aea608f3a228297d68e1ae4e619a3a2; the changedclients/python/matrixone/stage.pyblob is1a89e7a327a41b9d3a04be40714c1d15a81e222cat both merge8111f870f5d8cee40c53fc48bcbcde8292da1fa5and pinned main.f8c872001603fed3d23784e1ada26f9a2d8f4fbareproduced the bug through both public sync and asyncalter(comment=''): each raisedValueError, and a second SQL session still read the prior comment.ALTER STAGE <name> SET COMMENT=''; metadata read through independent sessions returned an empty comment. Negative controls for no options,url='', andcredentials={}still raisedValueError, executed zero SQL statements, and preserved the existing comment; a valid clear succeeded after each sequence.This used the owned local service at
127.0.0.1:60220, version8.0.30-MatrixOne-v1.3.0, binary source6f773c556d4f3177f5373eb193cd576e080b662f(SHA-25651489b59a60310e79eddcf1182c582685b2c60f800f35a0a625eb5359469349b). No service build was performed; this is a Python SDK change validated against the existing local backend. The issue-specific live behavior and negative controls passed. ExistingAriznawlllassignment was already in place and was left unchanged.Ariznawlll commentedon Oct 24, 2026
测试版本
main;commit:a1888d62f89232a9bbe5830881b4f9b4d749cf42(修复 PR fix(python-sdk): allow clearing stage comments #30965 的 merge commit8111f870f5d8cee40c53fc48bcbcde8292da1fa5为其祖先)。6cb033ea67757407ebdb946f784366b3a7819a11c61cd1a0fb4dac7a7ea1caab;构建元数据vcs.revision为上述 SHA,工作树已跟踪源码无改动。原问题验证
通过 Python SDK 公开
Client.stage和AsyncClient.stageAPI 创建 comment 为before的临时 stage,再调用alter(comment='')。同步、异步各连续 3 轮均成功;每次使用另一独立 SQL 连接读取mo_catalog.mo_stages,实际 comment 为长度 0 的空字符串,非旧值或 NULL。PR #30965 已合入当前 main。Happy Path 覆盖
Unhappy Path 覆盖
url=''、credentials={}:同步/异步均抛ValueError;独立连接复查 comment 仍为before,各 3/3。之后合法清空仍可成功,证明失败没有污染状态。白盒验证
在同一 main SDK 源码上,
tests/offline/test_query_execution_state.py与test_stage_sql.py合计 57 项各跑 3 轮,均通过;该问题是 Python 参数存在性校验,不适用 Go race。回归测试
PR #30965 已在
clients/python/tests/offline/test_stage_sql.py添加同步/异步清空与无效选项回归;本轮另用隔离真实服务脚本/private/tmp/qa_sdk_a188_stage.py补持久化读回。MOTR SQL 不能覆盖 Python SDK 的None与空字符串校验,未新增 PR。PR 的 Python SDK offline CI 和 CI Required 成功,online CI 跳过;本轮定向在线 3 轮通过,未跑全量 SDK/SQL BVT。测试证据
eeb97781e070894c34f361b2c4f7f46e785bb16ed518baf097da11b5dc8455e3;复查 stage 数为 0、测试数据库已删除,服务正常退出。测试结论
测试通过。