Skip to content

feat(python): ship public API type stubs - #50

Merged
prrao87 merged 2 commits into
mainfrom
codex/issue-22-python-stubs
Oct 26, 2026
Merged

prrao87 merged 2 commits into
mainfrom
codex/issue-22-python-stubs

Conversation

@stugorf

@stugorf stugorf commented Oct 26, 2026

Copy link
Copy Markdown
Member

Problem and change

Resolves #22. Publish PEP 561 typing metadata for the compiled lance_csr._internal.graph module and the public facade, including all enums, graph/query classes, and DirNamespace. Signatures match the PyO3 definitions; dataset dictionaries, scalar parameters, execution options, and statistics returns receive concrete types.

A strict consumer exercises the public surface, including expected type errors. Runtime tests compare exported classes, members, argument kinds, and defaults against the installed stubs. The wheel smoke check now requires the marker and both stub files. The handwritten API reference and Python development guide explain usage and local validation. pyarrow-stubs is a development dependency only.

Validation

Head 6175122bd24cc8fe95ddd4cf82d7492975ea6e7d; frozen parent 54e02307a48e467a98d9da2183f5adcb767e7c99. Focused checks and regression details record commands, results, documentation and compatibility. The release receipt pins wheel/archive identity and 3 installed tests.

Both complete workloads pass unchanged goldens in memory and lazy modes. Retained first-pass geometric mean speedups are below (greater than one is faster). Per-query results and paired investigations remain in the audit archive.

Workload/mode Main Actual parent
Q30 memory 0.984 0.984
Q30 lazy 0.908 0.908
IC memory 0.987 0.987
IC lazy 0.993 0.993

Measurements use the same Apple M4 Max (16 cores, 128 GiB), macOS 26.6.2 arm64 and Python 3.13.17, with Q30 revision 6260689 and IC revision c185123. Reproduction instructions pin settings, data checksums, locks and commands. The frozen main baseline is code-identical to current main 90114f3; the equivalence check also verifies clean prospective main-target merges.

Individual review gates pass under the recorded repeat/controlled-investigation rules. Initial failed measurements remain intact in the audit record.

User impact

Ships py.typed and stubs matching top-level/compiled graph exports, DirNamespace, enums, methods and properties. Wheel/sdist content, strict consumer typing and runtime parity are checked. Handwritten API documentation remains.

Review ledger · Current contribution guide

Audit archive: 47,675,190 bytes; SHA-256 b3486fb30a34639c830b5d49353b3838f96369f95df959ac35f85511f7f8b2de. The small current-main supplement preserves the documentation update. Original absolute paths in receipts map to included records through the archive index.

Submitted by David Hughes (@stugorf), with AI Collaboration.

stugorf and others added 2 commits October 25, 2026 09:56
Add PEP 561 stubs matching the extension graph module, strict consumer checks, and runtime signature parity tests. Document the typing workflow and check wheel inclusion. Runtime and benchmark validation remain pending the coordinated build.
# Conflicts:
#	docs/api-reference.md
@prrao87
prrao87 marked this pull request as ready for review October 26, 2026 16:37
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Oct 26, 2026 •

Copy link
Copy Markdown

Deploying lance-csr with  Cloudflare Pages  Cloudflare Pages

Latest commit: 9e4cbb8
Status: ✅  Deploy successful!
Preview URL: https://15da7386.lance-csr.pages.dev
Branch Preview URL: https://codex-issue-22-python-stubs.lance-csr.pages.dev

View logs

@prrao87
prrao87 merged commit 3c5f333 into main Oct 26, 2026
6 checks passed
@prrao87
prrao87 deleted the codex/issue-22-python-stubs branch October 26, 2026 16:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Ship type stubs for the Python package

2 participants