Skip to content

fix(python-sdk): allow clearing stage comments - #30965

Merged
mergify[bot] merged 2 commits into
matrixorigin:mainfrom
MatrixAdventurer:fix/30964-clear-stage-comment
Oct 23, 2026
Merged

mergify[bot] merged 2 commits into
matrixorigin:mainfrom
MatrixAdventurer:fix/30964-clear-stage-comment

Conversation

@MatrixAdventurer

Copy link
Copy Markdown
Contributor

What type of PR is this?

  • API-change
  • BUG
  • Improvement
  • Documentation
  • Feature
  • Test and CI
  • Code Refactoring

Which issue(s) this PR fixes:

Fixes #30964

What this PR does / why we need it:

StageManager.alter(..., comment='') and its async counterpart could not clear an existing stage comment because the shared option validator treated an explicit empty string as if the caller had supplied no option.

This change recognizes an explicitly supplied comment by presence (comment is not None) while preserving the existing rejection of no options, an empty URL, and empty credentials. The generated statement is ALTER STAGE <name> SET COMMENT=''.

Regression coverage exercises both public sync and async alter() paths and pins the preserved validation behavior.

Reproduction proof

  • Before the production fix, both new public-path comment-clearing tests fail with ValueError.
  • After the fix, the two comment-clearing cases and three negative controls pass.

Validation

  • Focused regression selection — passed (5 cases).
  • clients/python/tests/offline/test_stage_sql.py — passed (38 tests, independently rerun by the review agent).
  • Complete Python SDK offline suite — passed (1,310 tests; two existing SQLAlchemy/sqlite deprecation warnings).
  • Fatal flake8 rules (E9,F63,F7,F82) for both changed files — passed.
  • compileall for both changed files — passed.
  • git diff --check — passed.
  • Independent review — APPROVE after narrowing the validation change; no blocking findings.

Real-service Stage integration and the remote CI matrix are not claimed; CI will provide repository-supported integration coverage.

@qodo-code-review

Copy link
Copy Markdown

Qodo reviews are paused for this user.

Troubleshooting steps vary by plan Learn more →

On a Teams plan?
Reviews resume once this user has a paid seat and their Git account is linked in Qodo.
Link Git account →

Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center?
These require an Enterprise plan - Contact us
Contact us →

@mergify mergify Bot added kind/bug Something isn't working kind/test-ci labels Oct 23, 2026
@XuPeng-SH

XuPeng-SH commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

mo-bot review · mo-bot-local · done

Commit: 9eddc6b4680fae09a119c967ad5499814aaa89f3

Review completed. Read the assessment.

@XuPeng-SH XuPeng-SH left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mo-bot review · mo-bot-local · review

Commit: 9eddc6b4680fae09a119c967ad5499814aaa89f3

Assessment: approve

Reviewed the complete delta and affected callers. The shared validator correctly distinguishes an empty comment from an omitted comment for both sync and async APIs. The fix preserves existing rejection controls, reuses established SQL generation, and adds no material runtime cost. No actionable findings remain.

Model: gpt-6-astra / xhigh

Session: 01a13dcf-1517-7f90-b3f9-c5f9f9e7031b · slot 0 · generation 1

Validation:

  • Reused six successful exact-head Python offline CI matrix jobs; verified their workflow selects the offline suite and validates package distributions.

  • Supplemental probe passed 72 named base/head scenarios covering sync/async client and session routes, clearing, returned comments, rejection controls, and execution-error propagation. Receipt: checks/1792751622679544684-4.json; output: stage-boundary.log.

  • git diff --check passed. Receipt: checks/1792751637716462332-4.json; output: diff-check.log. Both receipts identify the assigned head and unchanged checkout.

  • Traced empty-comment handling through the existing server parser and catalog update implementation. Detailed evidence is retained in attempt-1/review-evidence.json.

Limitations:

  • No live-service execution: online CI was skipped and the supplemental probe uses mocked executors. Database persistence is supported by source tracing, not a new integration run.

  • The supplied evidence contains no worker validation artifacts, raw CI logs, or linked issue #30964 body. Author-reported test counts were not treated as independently verified results.

@mergify mergify Bot added the queued label Oct 23, 2026
@mergify

mergify Bot commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

Merge Queue Status

  • ✅ Entered queue — 2026-10-23 10:35 UTC · Rule: main · triggered by rule Automatic queue on approval for main
  • ✅ Checks passed · in-place
  • ✅ Merged — 2026-10-23 14:17 UTC · at 8111f870f5d8cee40c53fc48bcbcde8292da1fa5 · squash

This pull request spent 3 hours 42 minutes 25 seconds in the queue, including 46 seconds running CI.

Required conditions to merge

@aptend aptend left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed the full two-file diff at 9eddc6b, all review discussion and linked issue. The shared presence check correctly permits an explicit empty comment while preserving omitted-option/empty URL/empty credentials controls and enable=False. Traced sync/async client/session routes, existing SQL generation, returned Stage.comment and parser/catalog update handling of COMMENT=''. No blocking issue found.

Independent supplemental checks passed 28 sync/async client/session scenarios including returned empty comments, rejection before execution and execution-error propagation. Exact-head CI has six successful offline matrix jobs; raw Python3.10/SA1.4 and Python3.12/SA2.1 logs confirm 1319/1323 tests plus 95 subtests passing and successful wheel/sdist validation. Local probes use mocked executors; online CI was skipped, so no new live-service integration claim.

@XuPeng-SH XuPeng-SH left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Incremental review for exact head ca5a54376c3527b20efbdd03d841fa4df59e01ca (Merge branch 'main' into fix/30964-clear-stage-comment). The PR's effective delta remains limited to clients/python/matrixone/stage.py and clients/python/tests/offline/test_stage_sql.py; this synchronization commit introduces no additional PR-specific code change, and the previously reviewed explicit-empty-comment behavior remains unchanged. I found no new actionable issue. The latest head's Python offline version matrix is still in progress; MatrixOne unit/coverage/shared-build and online Python checks are skipped, so I am not treating prior-head results as validation for this SHA. Please recheck the exact-head offline matrix after completion.

@mergify
mergify Bot merged commit 8111f87 into matrixorigin:main Oct 23, 2026
28 of 29 checks passed
@mergify mergify Bot removed the queued label Oct 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/bug Something isn't working kind/test-ci

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Python SDK cannot clear a stage comment

3 participants