sdk: fix pyright test typing#320
Merged
Merged
Conversation
Co-authored-by: Lucas Parzianello <lucaspar@users.noreply.github.com>
Changed Files
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
credit_unstreamed_file_bytesprogress-bar typing to the structuralupdate()API it uses.Validation
npx --yes pyright@1.1.408 --pythonpath ./.venv/bin/python(0 errors)python3 -m uv run -p 3.13 ruff format --check --config pyproject.toml ...(changed files)python3 -m uv run -p 3.13 pyrefly checkNote: local full
prek run --all-filescould not install hooks in this container because the hook installer attempted to write to system Python; the source CIsdk-pre-commitjob is green.Note
Low Risk
Changes are typing and test assertions only, aside from a wider structural type for progress bars that still only calls
update().Overview
Clears pyright failures in the SDK test suite and tightens one production type hint, with no intended runtime behavior change.
credit_unstreamed_file_bytesnow accepts any object implementingupdate(n)via a newSupportsProgressUpdateprotocol, instead oftqdm[NoReturn], matching how callers pass progress bars.Tests are adjusted for stricter typing: explicit
is not Nonechecks before nested list access onDataset,User.model_validate({})andmodel_validatedicts for enum coercion,PurePosixPathforFile.directory(notPath),Mappingon gateway stubs, and narrowing mocked HTTP request bodies beforeparse_qs.Reviewed by Cursor Bugbot for commit 1d0b323. Configure here.