Repository navigation
fix(python): reject mapping rows in insert_values - #31635
mergify[bot] merged 2 commits into
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? |
|
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: 5d1d9837af9ff8de64d36dfea5ad6b026d1f2f33
Assessment: request_changes
Mapping rejection works, but eager materialization introduces silent data corruption for generators that reuse a row buffer.
Model: gpt-6-astra / xhigh
Session: 01a13dcf-1586-7a01-9000-d45e20995cf8 · slot 1 · generation 1
- P2
clients/python/matrixone/sql_builder.py:155: An outer generator updates and yields the same mutable list for successive positional rows.
Impact: list(values) retains aliases until iteration finishes, so the later copies contain the final row repeatedly. Validate and immediately copy each yielded row into temporary storage, then update builder state after validation succeeds. Add a reused-buffer regression case.
Evidence: The exact merge-base produces [(1, 'first'), (2, 'second') through SQLite execution; the candidate produces [(2, 'second'), (2, 'second')]. Reproduction: generator-control.py and generator-control.log; receipt checks/1793237372945735227-4.json. The added generator test yields independent lists and misses this case.
Validation:
-
123 focused tests passed.
-
Mapping/state-preservation and unaffected positional-input controls passed; baseline/candidate comparison confirmed the regression.
-
Black, Flake8 and diff whitespace checks passed. Receipts and logs reconciled in validation-summary.json; source unchanged.
Limitations:
- The complete offline suite was not rerun; its reported 2,333 passes lack supplied raw logs.
|
Addressed the P2 review finding in follow-up commit The implementation now validates and copies each yielded row immediately into temporary storage, then updates builder state only after the entire iterable succeeds. This preserves reusable mutable row buffers and keeps failure atomic. Added a regression generator that mutates and yields the same list twice. Verification:
|
|
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: 009fc225bb2c4975303e2952415a4ac3b370117a
Assessment: approve
Mapping rejection preserves pending INSERT state, and immediate row copying resolves the previously reported reusable-buffer regression. No actionable findings remain.
Model: gpt-6-astra / xhigh
Session: 01a13dcf-1586-7a01-9000-d45e20995cf8 · slot 1 · generation 1
Validation:
-
Reused supplied exact-head CI results: seven offline matrix jobs and two core-import jobs succeeded.
-
Extracted-class SQLite probe passed mapping rejection, iterator-failure atomicity, reusable-buffer and consumer controls.
-
Discussion coverage, source cleanliness and whitespace checks passed. Logs and receipts reconciled in validation-summary.json.
Limitations:
-
Local pytest could not start because pytest is unavailable; no local pytest pass is claimed.
-
CI raw logs were not supplied. The local probe does not validate full SDK imports.
✅ 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 #31612
What this PR does / why we need it:
MatrixOneSQLBuilder.insert_values()accepted mapping rows, converted each mapping to a list of keys, and bound those column-name strings as row data. This silently corrupted INSERT parameters instead of rejecting input that violates the positional-row API.Validate each yielded row and copy it immediately into temporary storage before mutating builder state. This rejects any
collections.abc.Mappingrow, keeps failures atomic, preserves outer generators, and supports generators that reuse a mutable row buffer.Regression coverage verifies:
dictand a genericMappingare rejected;Verification
compileall, andgit diff --check: passed.