Repository navigation
Fix the ty static checks (speedkick) - #1595
Merged
edwinyyyu merged 1 commit intoSep 9, 2026
Merged
Conversation
The lint workflow's ty jobs (common, client and server, each on the oldest and newest supported Python) fail on every pull request. Nine of the eighteen diagnostics are a real breakage rather than a typing nit: nebula5-python 5.3.0 removed NebulaAsyncClient, SessionConfig and SessionPoolConfig -- all of them in nebulagraph_python.client's __all__ in 5.2 -- so the `>=5.2.1` specifier resolved to a release the NebulaGraph backend cannot import at all. 5.3's replacement, AsyncNebulaClient, has no public way to open a connection: NebulaAsyncClient.connect() is gone, __init__ leaves connection None and session_id -1, and the only initializer left is the private _init_client(), which nothing in the package calls. Its sync NebulaClient and NebulaPool are complete, so moving forward means either private API or running blocking gRPC in the async server. Cap the extra at <5.3 for now, which is the range the backend actually supports. Relocking also drops the runtime dependencies on pytest and pool that 5.3.0 added. The rest: - Construct the deliberately-invalid language-model parameters and API key through model_validate(), so pydantic rejects them and no static check has to be suppressed to express the test. - Set the mocked _cleanup_semantic_history with monkeypatch.setattr instead of assigning over the bound method. - Annotate the narrowed function-call output rather than casting it: ty now proves what the cast used to assert. - Stringify the LangGraph search-summary content before slicing it. It comes out of a model_dump()ed dict, so it is not necessarily a str, and a non-str value would have raised TypeError at runtime. `ty check` passes for all three projects across the versions CI checks, as do `ruff check`, `ruff format --check`, `uv lock --check` and the unit suite. The repository-root `ty check`, which CI does not run, still reports diagnostics under evaluation/, examples/, integrations/ and tools/. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01BcPSoGsQjnVJS8A5NkoGZN
This was referenced Sep 9, 2026
malatewang
pushed a commit
that referenced
this pull request
Sep 16, 2026
* Relock: the server never declared datasets uv.lock records datasets>=5.0.0 as a requirement of memmachine-server, and locks datasets, dill and multiprocess for it, but no pyproject in the workspace declares datasets. The entry arrived with #1477's lock (2026-08-13), whose pyproject changes added only the spaCy group, so `uv lock --check` has failed on main since then. Nothing caught it because the lock-check workflow runs only for pull requests that touch a dependency file, and the only such pull requests since have been dependabot's, for which the workflow regenerates the lock instead of checking it. Relocking removes the phantom requirement and the three packages that existed only to satisfy it (datasets, dill, multiprocess), plus the fsspec[http] extra that only datasets pulled in. No version moves. The evaluation scripts that import datasets do so lazily and were never covered by the lock. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> * Fix the ty static checks The lint workflow's ty jobs (common, client and server, each on the oldest and newest supported Python) fail on every pull request. Nine of the eighteen diagnostics are a real breakage rather than a typing nit: nebula5-python 5.3.0 removed NebulaAsyncClient, SessionConfig and SessionPoolConfig -- all of them in nebulagraph_python.client's __all__ in 5.2 -- so the `>=5.2.1` specifier resolved to a release the NebulaGraph backend cannot import at all. 5.3's replacement, AsyncNebulaClient, has no public way to open a connection: NebulaAsyncClient.connect() is gone, __init__ leaves connection None and session_id -1, and the only initializer left is the private _init_client(), which nothing in the package calls. Its sync NebulaClient and NebulaPool are complete, so moving forward means either private API or running blocking gRPC in the async server. Cap the extra at <5.3 for now, which is the range the backend actually supports. Relocking also drops the runtime dependencies on pytest and pool that 5.3.0 added. The rest: - Construct the deliberately-invalid language-model parameters and API key through model_validate(), so pydantic rejects them and no static check has to be suppressed to express the test. - Set the mocked _cleanup_semantic_history with monkeypatch.setattr instead of assigning over the bound method. - Annotate the narrowed function-call output rather than casting it: ty now proves what the cast used to assert. - Stringify the LangGraph search-summary content before slicing it. It comes out of a model_dump()ed dict, so it is not necessarily a str, and a non-str value would have raised TypeError at runtime. Same change as #1595 on speedkick, applied to main. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> --------- Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
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.
The lint workflow's six
tyjobs (common, client and server, each on the oldest and newest supported Python) fail on every pull request. This makes all six pass.The NebulaGraph half
Nine of the eighteen diagnostics are a real breakage rather than a typing nit. nebula5-python 5.3.0 removed
NebulaAsyncClient,SessionConfigandSessionPoolConfig— all three innebulagraph_python.client.__all__in 5.2 — sonebula5-python>=5.2.1resolves to a release whose import the NebulaGraph backend cannot even complete:async_get_nebula_clientraisesImportErrorat its use site, andnebula_graph_vector_graph_storehas no client type to annotate.Porting forward is not available yet. 5.3's
AsyncNebulaClienthas no public way to open a connection:NebulaAsyncClient.connect(hosts=..., username=..., session_config=..., session_pool_config=...)is gone.AsyncNebulaClient.__init__leavesconnection = Noneandsession_id = -1, and its public surface isclose,execute,execute_with_timeout,execute_py,ping,pq,print_query_result,is_closed_clientand theget_*accessors — noconnect,openor__aenter__._init_client(), which nothing in the package calls.Its sync
NebulaClient,NebulaPoolandClientPoolFactoryare complete, so the ways forward are private API or running blocking gRPC calls off the event loop — a backend rewrite, not a lint fix. This PR caps the extra at<5.3, the range the backend actually supports, and documents why at the declaration. Relocking also drops the runtime dependencies onpytestandpoolthat 5.3.0 added.The rest
missing-argumentdiagnostics were tests that deliberately omit a required field. They now go throughmodel_validate()with a dict, so pydantic — not a suppression comment — is what rejects the input.test_delete_episode_store_processes_in_batchesassigned a mock over a bound method behind a# type: ignore/# ty: ignorepair; it now usesmonkeypatch.setattr, and both comments are gone.test_password_mixin_invalid_typeloses its blanket# type: ignorethe same way.cast(ResponseFunctionToolCall, output)was redundant — ty narrowsoutputon theoutput.type != "function_call"guard. It is now an annotation, so the narrowing is proved rather than asserted._format_search_summarysliced values pulled out of amodel_dump()ed dict, which are not necessarilystr; a non-str value would have raisedTypeErrorat runtime. They are stringified before slicing.No
# type: ignore,# ty: ignore,Anyorcastwas added.Verification
ty checkpasses forpackages/common(3.10, 3.14),packages/client(3.10, 3.14) andpackages/server(3.12, 3.14) — the six CI jobs.ruff check,ruff format --check,uv lock --checkand the unit suite pass. The touched tests were run directly, including the integration-marked batch-deletion one.Out of scope: the repository-root
ty check, which CI does not run, still reports diagnostics underevaluation/,examples/,integrations/andtools/.🤖 Generated with Claude Code
https://claude.ai/code/session_01BcPSoGsQjnVJS8A5NkoGZN