fix: drop call-arg exclusion from internal modality/provider mypy overrides#258
Merged
Kamilbenkirane merged 1 commit intomainfrom Apr 10, 2026
Merged
fix: drop call-arg exclusion from internal modality/provider mypy overrides#258Kamilbenkirane merged 1 commit intomainfrom
Kamilbenkirane merged 1 commit intomainfrom
Conversation
…rrides After #256 fixed total=False on the modality Parameters TypedDicts, the call-arg exclusion in the big internal [[tool.mypy.overrides]] block (modalities.*.client / streaming / providers, providers.*, namespaces.domains) is no longer needed for the Unpack[*Parameters] pattern that originally required it. Removing it surfaced one previously-hidden real bug: GoogleImagesClient.model_post_init() forgot to forward self.base_url to the strategy client constructor (Gemini/Imagen). The wrapper would honor a custom base_url, but the strategy would silently default to None. Pass base_url=self.base_url at the call site. Also tightens the override surface: 6 disabled error codes instead of 7 on the same module list. The remaining codes (override, return-value, arg-type, assignment, no-any-return, attr-defined) cover the provider-mixin / multiple-inheritance typing patterns and are unrelated to #256. The tests.* override keeps call-arg disabled — 39 test files still construct provider clients without explicit base_url= and this PR intentionally leaves test ergonomics alone. Closes #257
Code reviewNo issues found. Checked for bugs and CLAUDE.md compliance. |
|
well done kamil that was a use pain point for us |
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
Removes
call-argfrom the big internal[[tool.mypy.overrides]]block (the one coveringmodalities.*.client / streaming / providers,providers.*,namespaces.domains). After #256 fixed the missingtotal=Falseon modalityParametersTypedDicts, this exclusion was no longer needed for theUnpack[*Parameters]pattern that originally motivated it.Closes #257.
What removing the exclusion exposed
Exactly one previously-hidden real bug, and zero noise:
GoogleImagesClient.model_post_init()constructs the strategy client (GeminiImagesClientorImagenImagesClient) but did not forwardself.base_url. The wrapper would honor a custombase_urlfrom its caller, but the strategy would silently default toNone— a real propagation bug. Fixed by passingbase_url=self.base_urlat the call site.What is NOT in scope
tests.*override — keepingcall-argdisabled. Removing it surfaces 39 errors in test files that construct provider clients (GoogleTextClient, etc.) withoutbase_url=. Test ergonomics over strict construction kwargs is a deliberate choice; this PR leaves it alone.override,return-value,arg-type,assignment,no-any-return,attr-definedare kept on the internal block. They cover unrelated provider-mixin / multiple-inheritance typing patterns and predate fix: add total=False to modality Parameters TypedDicts #256.Test plan
make lint— cleanmake format— cleanmake typecheck—Success: no issues found in 331 source files+63 source filesmake security— bandit cleanmake test— 586 passed, 82.29% coverage (≥80% threshold)make ci— full pipeline green