Skip to content

fix(python): restore SDK SQL and execution contracts - #31953

Merged
XuPeng-SH merged 5 commits into
mainfrom
codex/python-sdk-contracts
Oct 31, 2026
Merged

XuPeng-SH merged 5 commits into
mainfrom
codex/python-sdk-contracts

Conversation

@XuPeng-SH

Copy link
Copy Markdown
Contributor

What type of PR is this?

  • BUG
  • Improvement
  • Test and CI
  • Code Refactoring

Related issues

What this PR does / why we need it

Public SDK entry points generated obsolete or ambiguous SQL, misreported settings, or failed to preserve the intended execution owner. The changes consolidate restore and loader validation, preserve selectable identity and SQL literals, and extend the established autocommit and pool cleanup path. Full-text SQL generation and CDC maintenance use the existing identifier and literal quoting helpers. Regression cases cover rejection before dispatch, cancellation/cleanup paths, real database outcomes, and async index catch-up.

Validation

Author checks on the reviewed implementation (004739d):

  • Offline contract matrix: 2,870 / 2,866 / 2,874 cases, zero skipped, on SQLAlchemy 1.4.54 / 2.0.43 / 2.1.6 respectively; wheel's 60 Python files matched source and core imports worked without PyArrow.
  • Current-source native contract runner: 187 passed, zero skipped, including database, table, account, cluster and cross-account restore on an exclusively owned disposable server; full-text SQL harness: 19 passed, zero ignored.
  • Affected Go packages passed with mo-cgo-test -vet=all; incremental golangci-lint reported zero issues. The 4.2.5 full-text target checks passed, with its native prerequisite outcome checked rather than treated as fixed.

Independent Sol review of 004739d found no material remaining findings after fixes. Its separately built source passed 2,866 offline tests plus 95 subtests, 29 current-source native cases, 3 release-target checks, the three affected Go packages, incremental lint and wheel/source identity verification. This is an independent technical review, not a GitHub approval.

Refresh onto main 1565fb7 introduces only the upstream system-variable change; all reviewed files are byte-identical to 004739d. The refreshed combination was rebuilt and checked with native system-variable wire metadata and sync/async IVF, autocommit and pool reuse smoke tests. Refreshed checks on f8bb5b8:

  • python scripts/run_contracts.py --server current-source --output /tmp/sdk-refresh-native: 187 passed, zero skipped on an isolated source-built server at f8bb5b8.
  • python -m pytest tests/offline/test_non_transactional_sql.py tests/offline/contracts/test_mapped_query_identity.py tests/offline/test_fulltext_search_comprehensive.py -q: 258 passed, zero skipped (SQLAlchemy 2.0.43).
  • .agents/skills/mo-dev/scripts/mo-cgo-test -vet=all -count=1 -timeout=120s ./pkg/frontend ./pkg/sql/plan -run 'TestResolveVariableTypeDeclaresIntegerSystemVariables|TestIntegerSystemVariablePreparedWireMetadata|TestNonIntegerSystemVariablePreparedWireMetadataUnchanged|TestBindUserVariableCapturesEffectiveStringDomain|TestBindUserVariableStringDomainErrorsAndNonStringControls': both packages passed.

Limitations

Tests use isolated disposable single-node fixtures; they are not multi-CN, soak or production validation. Account and cluster restore tests require exclusive server ownership. No issues are automatically closed by this PR.

@CLAassistant

CLAassistant commented Oct 31, 2026 •

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
1 out of 2 committers have signed the CLA.

✅ XuPeng-SH
❌ Peng Xu


Peng Xu seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.

@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 →

@XuPeng-SH

XuPeng-SH commented Oct 31, 2026 •

Copy link
Copy Markdown
Contributor Author

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

Commit: f8bb5b8fe602283db06bc6a8621900e38e47af2d

Review belongs to an older commit; it is not a review of the current head.

@XuPeng-SH

XuPeng-SH commented Oct 31, 2026 •

Copy link
Copy Markdown
Contributor Author

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

Commit: 08444cefce30990030cf9eb51b3db9405ca8bee5

Review completed. Read the assessment.

@XuPeng-SH XuPeng-SH left a comment

Copy link
Copy Markdown
Contributor Author

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: 08444cefce30990030cf9eb51b3db9405ca8bee5

Assessment: approve

Reviewed all 31 changed files, affected owners and consumers, linked issues, and complete discussion. SDK contract corrections and native fulltext fixes preserve existing ownership and lifecycle guarantees. No actionable defects remain.

Model: gpt-6-astra / xhigh

Session: 01a1869d-820c-7212-9788-aecfb86a4141 · slot 0 · generation 2

Validation:

  • Isolation preflight passed; native prerequisites verified against 193 current inputs and seven artifact hashes.

  • Three Go owning packages passed with vet=all: 205 root tests, 348 tests/subtests, zero failures or skips.

  • 315 focused Python SDK tests passed with zero skips.

  • 11 maintained SDK online cases passed against an isolated server built from the assessed head, covering restore, lineage DDL, mapped joins, fulltext maintenance and asynchronous parser catch-up.

  • Final audit verified unchanged source, exact patch correspondence, all four discussion keys, and matching receipts/logs. Records are retained in attempt-1/validation-summary.json, discussion-assessment.json and final-audit-receipts.json.

Limitations:

  • Broader account/cluster restore and released-server checks remain author-reported; no local multi-CN soak or exact BVT harness run was performed.

  • Frozen CI contains pending Go/build/static-analysis checks and skipped SDK online execution; these were not counted as passes.

  • The CLA administrative notice remains outside this technical assessment.

@XuPeng-SH
XuPeng-SH merged commit 569d521 into main Oct 31, 2026
@XuPeng-SH
XuPeng-SH deleted the codex/python-sdk-contracts branch October 31, 2026 18:10

This branch was successfully deployed

No deployments
ci — 302e61b7 Deployed Oct 31, 2026 by XuPeng-SH
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/enhancement kind/refactor Code refactor kind/test-ci size/XXL Denotes a PR that changes 2000+ lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants