Repository navigation
fix(python-sdk): honor enable=False when creating a stage - #31522
mergify[bot] merged 2 commits into
Conversation
StageManager.create and AsyncStageManager.create had no enable parameter, and the CREATE STAGE builder dropped the one it received, so a stage meant to start disabled was created usable. Emit ENABLE=FALSE (before COMMENT, as the grammar requires) when enable is False. Enabled stays the default and emits no clause, so the server keeps its default status. Refs matrixorigin#31389
Qodo reviews are paused for this user.Troubleshooting steps vary by plan Learn more → On a Teams plan? Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center? |
|
mo-bot review · Commit: Review completed. Read the assessment. |
XuPeng-SH
left a comment
There was a problem hiding this comment.
mo-bot review · mo-bot-local · review
Commit: da6146e900316b429ddb8585500e53c1ae503d88
Assessment: approve
The complete delta correctly propagates enable=False through sync and async creation, preserves existing defaults and positional arguments, and follows server clause ordering. Catalog readback remains authoritative. No actionable introduced defects or substantive prior review concerns remain.
Model: gpt-6-astra / xhigh
Session: 01a13dcf-1517-7f90-b3f9-c5f9f9e7031b · slot 0 · generation 1
Validation:
-
64 focused repository tests passed; stage-tests.log matches checks/1793165016404656747-3.json.
-
16 diagnostic SDK tests passed, covering catalog results, session ownership, escaping, errors and cancellation; stage-probe.log matches checks/1793165138550776034-3.json.
-
Baseline control confirmed the previous API rejected enable and preserved existing parameter compatibility; base-control.log matches checks/1793165138356265110-3.json.
-
Verified unchanged server grammar/status handling, clean frozen source and git diff --check. Saved discussion-assessment.json and validation-manifest.json under /home/xupeng/.local/state/mo-bot/jobs/4da80d43745266e565668fc7/attempt-1; evidence-audit.log matches checks/1793165350257743416-4.json.
Limitations:
-
Validation used Python 3.13.5 and SQLAlchemy 2.1.6 with executor doubles; no live-server run or full offline suite was performed.
-
SDK escaping predates this change. The linked issue's broader quoted-value catalog round-trips are not established here; existing frontend name restrictions and catalog interpolation remain unchanged.
✅ Merged into
|
| Condition | Required by | |
|---|---|---|
| ✅ | #review-threads-unresolved = 0 |
GitHub branch protection |
| ✅ | github-review-approved |
GitHub branch protection |
The batch, tested in place
| Condition | Required by | |
|---|---|---|
| ✅ | any of: check-success = CI Required, check-neutral = CI Required, check-skipped = CI Required |
GitHub branch protection |
Times in UTC · dashboard · how the merge queue works
What type of PR is this?
Which issue(s) this PR fixes:
Fixes #31389
What this PR does / why we need it:
Root cause.
StageManager.create()andAsyncStageManager.create()had noenableparameter,_prepare_create()always passedenable=True, and_build_create_stage_sql()ignored the value anyway (# Note: enable is not included in SQL). So there was no way to create a stage that starts disabled, even though the server grammar supports it (create_stage_stmt: CREATE STAGE ... urlparams stage_credentials_opt stage_status_opt stage_comment_opt) andALTER STAGEin the same file already emitsENABLE=....The second half of #31389 (unescaped URL / credentials / comment /
get_stageWHERE value) is already fixed onmain: every value now goes throughsql_string_token/sql_literal/sql_object_name. This PR closes the remaining part.Fix.
enable: bool = Trueto the sync and asynccreate()and to_prepare_create(), and pass it through.ENABLE=FALSEwhenenableisFalse, placed beforeCOMMENTas the grammar requires.enable=True(the default) still emits no clause, so the server keeps its default status (in_useindoCreateStage) and existing SQL is unchanged.Tests (
clients/python/tests/offline/test_stage_sql.py):test_create_stage_disabled_emits_enable_false: synccreate(..., enable=False, comment=...)emitsCREATE STAGE my_stage URL='file:///data/' ENABLE=FALSE COMMENT='later'.test_async_create_stage_disabled_emits_enable_false: the same check for the async manager.test_create_stage_default_keeps_server_default_status:enable=Truestill emits the unchanged SQL.Results:
TypeError: create() got an unexpected keyword argument 'enable'). After the fix, all 3 pass.pytest tests/offline(Python 3.13, run locally): 2289 passed, 95 subtests passed.black --check -l 120 -Sandflake8are clean on the changed files.2 files, +41/-5.
本操作由 LW 授权的 Grok Bot 智能体执行