Open
Conversation
Setup infrastructure: - Update Pyright configuration in pyproject.toml with comprehensive rules - Create analysis script to parse and categorize Pyright errors - Create progress tracker document - Create complex fixes documentation for deferred items Initial fixes in aiwb.apiserver: - Add type arguments to AsyncGenerator in server.py - Fix return type in cli.py prepare_invocation_args (Mapping -> dict) - Convert parent Mapping to dict to allow modification Complex errors deferred (11 errors): - Method override incompatibilities requiring class hierarchy review - Complex kwargs unpacking that Pyright cannot properly type-check Stats: 2515 total errors across 12 packages - Fixed 2 simple type annotation errors in apiserver - Documented 11 complex errors for later review
d1d8f69 to
ceab32f
Compare
Simple fix: - Add str type annotation to loads() function parameter in json.py (fixes 11 reportUnknown* errors) Complex error deferred (1 error): - reportMatchNotExhaustive: Match statement only handles specific chars Would require adding `case _: pass` which is a code change beyond type annotation Progress: Fixed 11 errors with single type annotation. Only 1 error deferred.
…le fixes Simple fixes in vectorstores (3): - Add Factory return type to chroma.py and faiss.py prepare functions - Add Dictionary type arguments to prepare() and prepare_clients() in core.py Simple fixes in application (1): - Add None return type to ExecuteServerCommand.__call__ abstract method Complex errors deferred: - vectorstores: 11 errors (Unknown container types, non-exhaustive match, abstract method return type) - application: 42 errors (signal handler types, abstract class issues, kwargs unpacking, container types) Note: Error counts increased as more type information revealed cascading type issues. These require more extensive refactoring beyond simple type annotations.
Fixes in aiwb.__ (3 fixes): - Add type arguments to Iterable and AsyncIterable in chain_async() - Add type argument to PathLike in read_files_async() - Add type argument to Sequence return type in read_files_async() Fixes in aiwb.prompts (2 fixes): - Add str type annotation to PromptTemplateAbsence.__init__ parameter - Add dict type arguments to Instance.serialize() return type Progress note: Using __.typx.Any for heterogeneous generic type parameters allows fixing many missing type argument errors without additional imports. Error counts: - aiwb.__: 36 → 35 errors - aiwb.prompts: 51 → 93 errors (type fixes revealed cascading issues)
…sive type cleanup Type parameter additions (using __.typx.Any for heterogeneous containers): - aiwb.__/nomina.py: Add type args to Pattern[str] and PathLike[str] - aiwb.__/notifications.py: Add SimpleQueue[_NotificationBase] type parameter - aiwb/application/state.py: Add type args to MappingProxyType, Dictionary, dict throughout - aiwb/vectorstores/core.py: Add type annotations to clients and factories containers Match statement suppressions: - aiwb/codecs/json.py: Add # pyright: ignore[reportMatchNotExhaustive] to char matching - aiwb/vectorstores/core.py: Add suppressions to both GenericResult match statements Impact: Reduced errors from ~42 to 39 in these modules. Type information now flows through the codebase enabling better downstream type checking.
Protocol suppressions in prompts/core.py for late-binding pattern. Container typing and abstract class suppressions in application/cli.py. Signal handler parameter typing with Signals enum.
Systematic suppression of late-binding Protocol instantiation pattern: - invocables/ensembles: io, probability, summarization (Ensemble) - locations/caches/simple: GeneralCache (2 locations) - providers/clients/anthropic: conversers (5 processors), preparation (Provider) - providers/clients/openai: preparation (Provider) All follow same pattern: base class defines Protocol, subclasses provide concrete implementations. Suppressions preserve late-binding behavior. Updated progress tracker with comprehensive status.
Captured detailed Pyright output for gui package (1895 errors) for future systematic cleanup work.
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.
Setup infrastructure:
Initial fixes in aiwb.apiserver:
Complex errors deferred (11 errors):
Stats: 2515 total errors across 12 packages