Repository navigation
fix: generate valid CLONE SQL in async Python SDK - #27177
Conversation
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? |
XuPeng-SH
left a comment
There was a problem hiding this comment.
Deep-reviewed exact head 9093749.
The legacy async manager now reuses the established clone builder, producing the parser-compatible IF NOT EXISTS position and brace-form snapshot option for both DATABASE and TABLE CLONE. The table form is valid because the source table_name nonterminal carries table_snapshot_opt; database CLONE has the corresponding explicit snapshot option. The shared-builder refactor preserves existing sync/unified-async output and does not alter execution, connection, or error lifecycles.
Validation: all 8 focused legacy AsyncCloneManager cases pass, all 29 clone-builder tests pass, compileall passes, diff-check is clean, and exact-head CI is terminal green. No MatrixOne process was started.
Merge Queue Status
This pull request spent 42 minutes 18 seconds in the queue, with no time running CI. ReasonThe pull request can't be updated
HintYou should update or rebase your pull request manually. If you do, this pull request will automatically be requeued once the queue conditions match again. Requeued — the merge queue status continues in this comment ↓. |
|
Mergify's automatic queue check failed because its GitHub App was refused permission to create or update |
aptend
left a comment
There was a problem hiding this comment.
Deep-reviewed exact head 9093749. The legacy async clone manager now delegates SQL construction to the same BaseCloneManager used by the sync and transaction-aware async implementations. This fixes IF NOT EXISTS placement and emits the parser-supported snapshot option for both database and table clones, while preserving the existing public method signatures and client execution path. The shared builder refactor is output-equivalent for the already-correct managers, and the new tests cover all option combinations. Diff check and Python bytecode compilation pass; the focused test module could not run locally because this checkout lacks pytest, while exact-head CI and another exact-head focused run are green.
9093749 to
ec40374
Compare
0499bc3 to
2cecdde
Compare
2cecdde to
7c18bb4
Compare
7c18bb4 to
96d3b7e
Compare
96d3b7e to
a10fe9b
Compare
Merge Queue Status
This pull request spent 19 minutes 6 seconds in the queue, with no time running CI. Waiting for
All conditions
ReasonPull request #27177 has been dequeued Pull request from fork cannot be queued. This pull request comes from a fork, and Mergify needs the author's permission to update its branch.
HintYou should look at the reason for the failure and decide if the pull request needs to be fixed or if you want to requeue it. Tick the box to put this pull request back in the merge queue (same as
|
What type of PR is this?
Which issue(s) this PR fixes:
Fixes #27087
What this PR does / why we need it:
Root cause
The public
AsyncCloneManagerinclients/python/matrixone/async_client.pyhad its own SQL construction. It placedIF NOT EXISTSafter the destination name and emitted snapshots asFOR SNAPSHOT 'name', while MatrixOne's CLONE grammar requiresIF NOT EXISTSbefore the destination and brace-form snapshot options.Changes
BaseCloneManager.IF NOT EXISTS-only, and combined options.Issue-to-test proof
TestAsyncCloneManagernow asserts the exact SQL sent to the executor for both database and table cloning across:IF NOT EXISTSclone; andIF NOT EXISTS(the issue reproduction combination).A parser-level check also accepted the resulting table/database forms and rejected the legacy
FOR SNAPSHOTform.Tests
cd clients/python && python -m pytest tests/offline/ -v --tb=shortcd clients/python && python -m pytest tests/offline/test_async_client_query_comprehensive.py -q -k 'TestAsyncCloneManager'cd clients/python && python -m pytest tests/offline/test_clone_builder.py -qcd clients/python && python -m pytest tests/offline/test_sqlalchemy_integration.py -qcd clients/python && python -m pytest tests/offline/test_unified_transaction.py -qPYTHONPATH=clients/python python -m compileall -q clients/python/matrixone/clone.py clients/python/matrixone/async_client.pyThe online suite was not run because it requires a live MatrixOne service; this change is covered by deterministic SDK unit tests and the server parser grammar check.
Residual risks
No execution, transaction, or identifier-handling behavior was changed. Snapshot-name escaping remains governed by the SDK's existing interpolation behavior and is outside this issue's scope.