Skip to content

fix(python-sdk): honor explicit configuration overrides - #31313

Merged
mergify[bot] merged 2 commits into
matrixorigin:mainfrom
MatrixAdventurer:fix/python-config-override-precedence-20261027
Oct 26, 2026
Merged

mergify[bot] merged 2 commits into
matrixorigin:mainfrom
MatrixAdventurer:fix/python-config-override-precedence-20261027

Conversation

@MatrixAdventurer

Copy link
Copy Markdown
Contributor

What type of PR is this?

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

Which issue(s) this PR fixes:

Closes #31312

What this PR does / why we need it:

When MATRIXONE_PORT or MATRIXONE_CONNECT_TIMEOUT contains an invalid integer, an explicit valid keyword override still fails during environment parsing. Skip environment lookup for explicitly supplied keys so the documented explicit > environment > default precedence holds. Unoverridden invalid values still raise ValueError.

Add eight public-entry regression cases covering numeric overrides including zero, kwargs/tuple consumers, false/empty overrides, normal environment conversion, defaults and invalid unoverridden fields. Before the fix: five failed, three passed. After: all eight pass.

Validation: complete Python SDK offline suite 1962 passed + 95 subtests on Python 3.12.14 / SQLAlchemy 2.0.55; CI fatal flake8 selection, new-test lint and git diff --check pass. Two files, +79 lines; two production lines.

This is local configuration selection, ending at returned dictionaries/tuples before connection acquisition; no SQL, transport or persisted contract changes, so live server BVT is not applicable. Hosted CI has not been verified.

由 LW 授权的 ChatGPT Agent 操作。

@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 26, 2026
@XuPeng-SH

XuPeng-SH commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

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

Commit: 680d7593cfe32e6d09bdd7c48ef530cf1c320092

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: 680d7593cfe32e6d09bdd7c48ef530cf1c320092

Assessment: approve

Reviewed the complete two-file delta and frozen discussion. The fix restores documented precedence in the existing configuration owner, preserves explicit falsy values, and retains errors for unoverridden invalid settings. Tests cover the relevant public outputs and boundaries. No actionable findings remain.

Model: gpt-6-astra / xhigh

Session: 01a13dcf-1517-7f90-b3f9-c5f9f9e7031b · slot 0 · generation 1

Validation:

  • Differential execution of frozen base/head configuration modules confirmed the fix, unchanged defaults/environment conversion, unoverridden ValueError behavior, and output-helper compatibility. config-differential.log matches checks/1793035756185557432-4.json.

  • Reused six successful exact-head Python SDK CI matrix jobs; inspected their workflow and the eight added regression cases.

  • git diff --check passed and source remained unchanged. discussion-assessment.json accounts for both informational comments. validation-audit.json reconciles evidence under /home/xupeng/.local/state/mo-bot/jobs/29ea85ff50a76123a6f27b8b/attempt-1.

Limitations:

  • The local check exercised the standalone configuration module; it did not repeat the installed-SDK suite or contact a database. This change ends before connection acquisition.

  • Raw CI logs and the linked issue body were not supplied; the behavioral contract was verified against the frozen PR and existing configuration documentation.

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

mergify Bot commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

Merge Queue Status

  • ✅ Entered queue — 2026-10-26 17:33 UTC · Rule: main · triggered by rule Automatic queue on approval for main
  • ✅ Checks passed · in-place
  • ✅ Merged — 2026-10-26 18:12 UTC · at 26e3289dd61a68fe8e84ba059cf2862ad2ca5e40 · squash

This pull request spent 39 minutes 26 seconds in the queue, including 2 minutes 19 seconds running CI.

Required conditions to merge

@mergify
mergify Bot merged commit 26e3289 into matrixorigin:main Oct 26, 2026
28 of 29 checks passed
@mergify mergify Bot removed the queued label Oct 26, 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.

[Bug]: Python config parses invalid environment values despite explicit overrides

2 participants