Repository navigation
fix(python-sdk): map SHOW ACCOUNTS columns by the server layout - #31527
mergify[bot] merged 2 commits into
Conversation
_row_to_account read SHOW ACCOUNTS as name, admin, created, status, comment, suspended_time, suspended_reason. The server emits account_name, admin_name, created_time, status, suspended_time, db_count, tbl_count, size, snapshot_size, comments, so Account.comment got suspended_time, suspended_time got db_count, suspended_reason got tbl_count, and the real comment was never read. Map columns by the server layout in one helper shared by the sync and async managers. SHOW ACCOUNTS has no suspension reason column (SUSPEND COMMENT stores the reason as the comment), so suspended_reason is None. Refs matrixorigin#31394
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: ae83b70730cbe1f280f74957e80aa50ac7a924e5
Assessment: approve
The shared mapper correctly restores comment and suspension metadata for sync and async callers. Server output and suspension-comment semantics support the changed expectations. Complete review found no actionable defects or substantive discussion concerns.
Model: gpt-6-astra / xhigh
Session: 01a13dcf-1586-7a01-9000-d45e20995cf8 · slot 1 · generation 1
Validation:
-
Recovered and verified attempt-1 receipts, commands, source fingerprints and logs; 39 account tests passed without skips.
-
Baseline/candidate probe reproduced the original defect and verified sync/async get/list, session executors, NULLs, short rows and trailing object_count.
-
Frozen CI reports seven successful Python/SQLAlchemy offline configurations and successful Python 3.8/3.9 core imports.
-
Source remained unchanged. Recovery audit, receipt-reconciliation.json and complete discussion-assessment.json are retained under /home/xupeng/.local/state/mo-bot/jobs/014ae5e10a8c043243d7e081/attempt-2.
Limitations:
-
No live-server round trip was run; online CI was skipped. Local probes used actual SDK managers with executor doubles.
-
Decoding remains positional. It matches the frozen server contract; arbitrary future column reordering and historical server layouts were not validated.
✅ 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 #31394
What this PR does / why we need it:
Root cause.
_row_to_account(in bothBaseAccountManagerandAsyncAccountManager) assumed this SHOW ACCOUNTS layout:name, admin, created, status, comment, suspended_time, suspended_reason.The server's actual layout, from
pkg/frontend/show_account.go(idxOfAccountName … idxOfComment, the same onmainand4.1-dev), is:account_name, admin_name, created_time, status, suspended_time, db_count, tbl_count, size, snapshot_size, comments.As a result:
Account.commentreceivedsuspended_time.suspended_timereceiveddb_count.suspended_reasonreceivedtbl_count.commentscolumn was never read, socreate_account(..., comment=...)andalter_account(comment=...)never round-tripped.Fix.
_show_accounts_row_to_account, maps the columns by the server layout (suspended_time= col 4,comments= col 9). The sync and async managers both use it.SUSPEND COMMENT '<reason>'stores the reason as the account comment (seeaccount_comment_optin the grammar). Sosuspended_reasonis nowNone, and the reason shows up incomment.Tests (
tests/offline/test_account.py):test_get_account_maps_show_accounts_columns_by_layout: given a real 10-column row,comment == 'quarterly audit',suspended_timeis the timestamp, andsuspended_reason is None.show_accounts_row()helper that builds the real layout. The suspend test now asserts the reason appears ascomment, together withsuspended_time.Results:
AssertionError: datetime(2026, 10, 27, 8, 0) != 'quarterly audit', meaning the comment field receivedsuspended_time. After the fix, they pass.pytest tests/offline(Python 3.13, run locally): 2287 passed, 95 subtests passed.flake8reports no new findings.blackis clean onaccount.py. It reports only one existing over-long line intest_account.py, which this PR does not touch.2 files, +55/-30.
本操作由 LW 授权的 Grok Bot 智能体执行