Skip to content

fix(py): widen create_model field spec annotations for pyright - #326

Merged
cpsievert merged 1 commit into
mainfrom
fix/py-create-model-pyright
Oct 13, 2026
Merged

cpsievert merged 1 commit into
mainfrom
fix/py-create-model-pyright

Conversation

@cpsievert

Copy link
Copy Markdown
Contributor

Supersedes #325, which pulled in the entire stacked ggsql-caching-reader + maps-capability history because its head branch (feat/maps-capability-py) is shared with #323. This PR contains just the pyright fix, based directly on main.

Summary

handoff_result_model() in pkg-py/src/querychat/_handoff_prompt.py builds pydantic field specs as inferred tuples. Newer pydantic stubs (with TypeForm) reject those inferred types as arguments to create_model() (reportCallIssue), which surfaced as a pyright failure on the Python 3.10 CI job. Adding explicit tuple[Any, Any] annotations widens the inferred types so the call type-checks.

The identical change is also present in #323 and #324; this PR lets it land on main immediately without waiting for the stacked feature work. The ruff cleanups that were also in #325 (de7d660d) only touch code from the stacked branches and remain with #323.

Verification

uv run pyright reports no errors for pkg-py/src/querychat/_handoff_prompt.py with this change, and uv run ruff check passes.

@cpsievert
cpsievert marked this pull request as ready for review October 13, 2026 15:08
@cpsievert
cpsievert merged commit bbe43ab into main Oct 13, 2026
13 checks passed
@cpsievert
cpsievert deleted the fix/py-create-model-pyright branch October 13, 2026 15:08
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.

1 participant