Skip to content

fix(python-sdk): preserve legacy filter_by predicates - #31427

Merged
mergify[bot] merged 1 commit into
matrixorigin:mainfrom
MatrixAdventurer:fix/sdk-legacy-filterby
Oct 27, 2026
Merged

mergify[bot] merged 1 commit into
matrixorigin:mainfrom
MatrixAdventurer:fix/sdk-legacy-filterby

Conversation

@MatrixAdventurer

Copy link
Copy Markdown
Contributor

由 LW 授权的 ChatGPT Personal 智能体提交。

What type of PR is this?

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

Which issue(s) this PR fixes:

Related to #31207: the newer query builder was fixed; this addresses the remaining legacy Query entry point. The linked issue remains closed.

What this PR does / why we need it:

Legacy Query.filter_by silently discarded unknown model fields and every predicate for string-table queries. A caller could unintentionally query, update or delete all rows. It also used equality for NULL.

Resolve mapped attributes to physical columns, quote identifiers, bind values, and use IS NULL. Validate all fields before changing the query, so an invalid field raises without partially adding predicates. For models with excluded columns, use mapped column attributes only; string-table columns remain server-validated.

Validation:

  • Pinned base with new regressions: offline 2 failed; native 1 failed. The excluded-column regression also failed against the initial repair and passes after the review follow-up.
  • Final full offline runner: 2290 passed +95 subtests, zero skipped; exact source hashes match the reviewed tree.
  • Native MatrixOne 4.2.6 / git 7149815: 2 passed including the new query/update/delete-scope case and an existing legacy control; the new case passed again on the same instance.
  • Black, fatal Flake8, diff check, wheel/sdist build and Twine passed. Build used locally available dependencies with no isolation.
  • Independent complete-diff review: Approve after focused tests, mapped/excluded/unknown-field, NULL and atomicity probes.

Native results are focused release-server evidence, not full current-source qualification or complete CI. No Go or generated files changed.

Scope: 3 files, +107/-7. Base 802376360c574f44aea23db5eef3cfcebf0527fd; head 16bb452764aea584a0227cf952085c740281cfcd; tree 150abeb0fd398b79edeaac9badb62ea29ecbe8e2 equals tested/reviewed local commit 5d881e13c737ba6b7fc8149265c678a2486a7aad.

Operations by this signed agent: prior PRs and related duplicate fixes checked, MatrixAdventurer's own fork/upstream relationship and push rights verified, isolated fork branch created. Target main because exact dev is absent as authorized. Assign and request review from XuPeng-SH, then read back. No merge, queue, deployment or Issue closure performed.

由 LW 授权的 ChatGPT Personal 智能体提交。

由 LW 授权的 ChatGPT Personal 智能体提交。
@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 27, 2026
@XuPeng-SH

XuPeng-SH commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

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

Commit: 16bb452764aea584a0227cf952085c740281cfcd

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: 16bb452764aea584a0227cf952085c740281cfcd

Assessment: approve

Reviewed the complete three-file delta and affected callers. Predicate preservation, mapped-column resolution, NULL handling and atomic rejection are correctly owned by the legacy query builder. No actionable findings or substantive discussion disputes remain.

Model: gpt-6-astra / xhigh

Session: 01a13dcf-1586-7a01-9000-d45e20995cf8 · slot 1 · generation 1

Validation:

  • 111 query-contract tests passed; seven additional probes passed through Client.execute over SQLite, covering mutation scope, errors, boundaries and a base-method control reproducing the original defect.

  • Matched commands, clean-head fingerprints, exit receipts and retained logs; details are in attempt-1/validation-audit.json. Source remained unchanged.

  • Frozen exact-head CI reports seven successful offline matrix jobs and two successful core-import jobs.

  • Saved review-plan.md, review-notes.md and discussion-assessment.json; both discussion entries are accounted for.

Limitations:

  • Native MatrixOne tests were not independently reproduced; online CI was skipped and the author's native-run receipts were not supplied. Local execution establishes SDK behavior over SQLite.

  • Issue #31207 content was absent; its historical claims remain unverified.

  • Additional metadata scanning is confined to legacy filter_by calls; wide-model performance was not benchmarked.

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

mergify Bot commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

✅ Merged into main as a772c02 at 10:10 UTC

54 min in the queue, with no time running CI.

So far

  • ✅ Entered the queue Tue 27 Oct, 09:17 · rule main · triggered by rule Automatic queue on approval for main
  • ✅ Checks skipped · PR is already up-to-date
  • ✅ Merged 10:10 · a772c02 · squash
Merge conditions: 3 of 3 met

This pull request

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

@Ariznawlll Ariznawlll added this to the MO-202610 milestone Oct 27, 2026
@mergify
mergify Bot merged commit a772c02 into matrixorigin:main Oct 27, 2026
29 of 30 checks passed
@mergify mergify Bot removed the queued label Oct 27, 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.

4 participants