Repository navigation
Align sqlite3 argument declarations with Python 3.15 - #9533
Conversation
Address all 24 SQLite entries from the actual whats_left Ubuntu signature report with typed argument declarations, matching parameter names and defaults. Correct positional/keyword binding, preserve dynamic fetchmany arraysize and missing execute parameters, and make Blob.__exit__ require its three arguments and return False. Source-reviewed against CPython 3.15.0 (d220409a13b77de7a6c30abe16ea90db01528edc). Normal formatting and pre-commit checks passed; native compile, runtime, clippy and canonical tests were not run locally because the dependency closure is unavailable. Existing Connection.__exit__ rollback/return and fetchmany uint32 range gaps remain outside this patch. Assisted-by: OpenAI Codex:model version not exposed
|
No actionable comments were generated in the recent review.
|
| Layer / File(s) | Summary |
|---|---|
Argument contracts and registration crates/stdlib/src/_sqlite3.rs |
New argument structs define positional and named rules, defaults, and boolean conversion. Statement completeness and function and aggregate registration use the updated arguments. |
Connection methods crates/stdlib/src/_sqlite3.rs |
Connection methods forward parsed execution arguments and update callback, configuration, and backup arguments. The backup database name defaults to "main", and Connection.__exit__ uses renamed exception parameters. |
Cursor execution and sizing crates/stdlib/src/_sqlite3.rs |
Cursor execution methods use parsed arguments and updated parameter names. arraysize and fetchmany use unsigned sizes, and setoutputsize uses parsed positional arguments. |
Blob read, seek, and context exit crates/stdlib/src/_sqlite3.rs |
Blob.read and Blob.seek use parsed arguments with defaults. Blob.__exit__ accepts three exception arguments and returns false. |
Estimated code review effort: 3 (Moderate) | ~20 minutes
Change: Bug fix
Possibly related issues
- Upgrade Python libraries and test from Python 3.14 #6839: The pull request aligns several
_sqlite3signatures with CPython 3.15 and addresses part of the standard-library migration.
Possibly related PRs
- RustPython/RustPython#9535: Both changes update
Connection.__exit__. - RustPython/RustPython#9503: Its
FromArgsbinding changes relate to the positional argument rules added here. - RustPython/RustPython#9536: It adds the signature comparison used to validate these API changes.
Suggested reviewers: youknowone
Merge Risk: 
Minimal · up to 19a79
-
No concrete merge-blocking issue was identified. The changes appear mergeable subject to normal build and SQLite test validation.
Pre-merge checks: 
4 · 
1
-
Failed checks: 1 warning Passed checks: 4 passed-
Full details: Title check
-
Explanation
The title "Align sqlite3 argument declarations with Python 3.15" matches the main change. The raw summary shows that the PR changes SQLite argument parsing (FromArgs structs, defaults, parameter names, and types) in crates/stdlib/src/_sqlite3.rs to match the CPython 3.15 signatures. The title is specific and concise, and it names the module and the target version. It does not cover every detail, such as the arraysize type change, but it does not need to.
-
Full details: Docstring Coverage
-
Explanation
Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 11 functions across 1 files.
Resolution
Write docstrings for the functions missing them to satisfy the coverage threshold.
-
Finishing Touches
-
Generate unit tests (beta)
-
- Create a new PR
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Print the mismatches already computed by the existing whats_left invocation so the SQLite cohort can be compared with its actual baseline. Reuse the reviewed one-line --signature reporting change from RustPython#9530; no new scan, import, or build is added. Workflow actionlint and zizmor validation remains pending CI. Assisted-by: OpenAI Codex:model version not exposed
Merging this PR will not alter performance
Comparing Footnotes
|
Actual macOS CI on 0fc193e reported test_bpo37347 as an unexpected success twice. Its progress-handler n keyword now binds correctly. Regenerate the canonical file through scripts/update_lib migrate with the exact remaining marker metadata, removing only this expectedFailure while preserving both recursive-cursor skips and all test bodies. Normal pre-commit hooks passed. The original full-suite failure and the new-head validation are separate; native tests were not rerun locally. Assisted-by: OpenAI Codex:model version not exposed
📦 Library DependenciesThe following Lib/ modules were modified. Here are their dependencies: [x] lib: cpython/Lib/sqlite3 dependencies:
dependent tests: (2 tests)
Legend:
|
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Resolve the Connection.__exit__ overlap by keeping the signature argument names and main rollback/False behavior. Preserve the existing canonical marker retirement and signature diagnostic output. Assisted-by: OpenAI Codex:model version not exposed
Store arraysize and bind fetchmany size as u32, matching Python 3.15. Preserve the current arraysize fallback and size=1 metadata, and rely on the existing unsigned index converter for negative ValueError and oversized OverflowError. The row loop still grows its result only as rows are returned and does not reserve by the declared limit. This follow-up depends on the sqlite signature branch at b5c50e7. Independent source review and normal hooks passed; no local native compilation, runtime tests, or allocation-heavy boundary probes were run. Exact error wording and CPython post-error setter storage are not claimed identical. Assisted-by: OpenAI Codex:model version not exposed
Head branch was pushed to by a user without write access
Summary
Address the 24 SQLite entries (3
_sqlite3, 21sqlite3) in the actual Ubuntuwhats_left --signatureoutput from #9530, head68646843423633e60bd54c6d4150db953b303804. That report compares normalizedinspect.signature, not raw__text_signature__.This changes only
_sqlite3.rs, using typed declarations rather than overriding displayed signatures:complete_statement,create_function,create_aggregate, andset_progress_handler.backup(name='main'), reject explicitfetchmany(None)while keeping the currentarraysizedefault, and preserve execute's missing-parameters semantics while exposingparameters=().setconfig, andsetoutputsize; match Clinic's integer/truth conversion for callback tracing, deterministic functions, and connection configuration.Blob.__exit__and returnFalse.Source comparison uses CPython 3.15.0, commit
d220409a13b77de7a6c30abe16ea90db01528edc,Modules/_sqlite/{module,connection,cursor,blob}.cand their generated Clinic headers. No Lib, snippet, assertion, shared binder, or workflow changes.Validation
git diff --check, rustfmt, normal configured pre-commit hooks (merge-conflict check, rustfmt, cspell).test_sqlite3, or RustPython/CPython runtime signature comparison. The local dependency cache/closure is unavailable; this remains Draft pending actual CI.cargo run --release --features sqlite -- -m test test_sqlite3 -v, plus required workspace/C-API tests and clippy. The existing keyword tests and expectedFailure markers are unchanged; no pass is claimed from their source alone.scripts/whats_left.py --signatureon the verified build; main's existing CI invocation currently reports only module counts. No claimed reduction is inferred from those counts.Existing gaps not claimed fixed
Connection.__exit__still returnsNoneand lacks CPython's rollback/chaining after a failed commit; this patch only renames its parameters.fetchmany/arraysizestill use signedc_intrather than CPython's full uint32 range.AI assistance
Implementation, source comparison, and independent source review were assisted by OpenAI Codex (model version not exposed). Normal hooks ran without bypass. Native runtime verification is outstanding as described above.
Summary by CodeRabbit