Repository navigation
fix(python-sdk): preserve numeric fulltext relevance scores - #32042
mergify[bot] merged 1 commit 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: 3fefdc0defd77ef27e7ecab28781638a60af6bfb
Assessment: approve
The Float result type correctly preserves relevance scores through projection, aggregates and derived queries while retaining predicate behavior. No actionable defects remain.
Model: gpt-6-astra / xhigh
Session: 01a1869d-820c-7212-9788-aecfb86a4141 · slot 0 · generation 2
Validation:
-
101 focused tests passed, including all nine new regressions, on Python 3.11.14 / SQLAlchemy 2.0.43. Evidence: focused.log, focused.xml, checks/1793665721104691445-3.json.
-
Baseline controls reproduced boolean conversion; candidate controls passed for aggregates, subqueries, UNION ALL, empty/NULL results, predicates, dialect processors and Client.execute. Evidence: score-consumers-retry.log, checks/1793665802881483727-3.json.
-
Reused frozen-head CI results: eight SDK offline jobs and two core-import jobs succeeded.
-
Source remains unchanged. Review plan, complete discussion assessment and receipt reconciliation are retained in review-plan.md, discussion-assessment.json and review-validation.json.
Limitations:
-
No live MatrixOne scoring or multi-CN validation was performed; online CI was skipped. Local checks isolate the changed client conversion boundary.
-
The preexisting FulltextFilter.label issue #32026 remains outside this change.
✅ Merged into
|
Replace ad-hoc label object with SQLAlchemy Label while preserving standalone compile() strings. Keep upstream numeric Float fix from matrixorigin#32042 intact. Refs matrixorigin#32026. 由LW授权的ChatGPT Business智能体提交。
What type of PR is this?
Which issue(s) this PR fixes:
Fixes #32027.
What this PR does / why we need it:
Selecting an unlabelled FulltextFilter through SQLAlchemy currently converts every nonzero MATCH relevance score into True. Declare the expression as Float so scores such as 0.09061906 and 0.75 remain distinct numeric values while the expression remains usable as a WHERE predicate.
Add nine offline regressions covering Boolean, natural-language and query-expansion expressions, unfiltered projections, bare WHERE predicates and numeric thresholds. Assertions cover distinct positive scores, zero, negative values and NULL, and verify MySQL SQL compilation retains MATCH without an '= 1' wrapper. SQLite execution substitutes stored scores only for server-side MATCH evaluation while retaining SQLAlchemy's actual result processing and predicates. This does not change the separate label() behavior reported in #32026.
Validation on main base 07c0607, Python 3.12:
Environment notes: the initial 2.1.6 collection lacked greenlet; after installing it, DDL tests exposed missing SDK dialect entry-point registration. Installing the SDK distribution and rerunning with the repository source first on PYTHONPATH produced the final full-suite pass above. Earlier runs before workspace restoration are not used as the final validation result.
Limits: no live MatrixOne fulltext server, SQL BVT, or performance benchmark was run. The tests isolate the SDK conversion defect and do not qualify server scoring/tokenization. Only two files change.