Fix invalid **kwargs type annotation in Authenticate constructor - #296
Open
pctablet505 wants to merge 1 commit into
Open
Fix invalid **kwargs type annotation in Authenticate constructor#296pctablet505 wants to merge 1 commit into
pctablet505 wants to merge 1 commit into
Conversation
**kwargs was annotated as Optional[Dict[str, Any]], which incorrectly types the whole kwargs mapping rather than the type of each value. The correct annotation for **kwargs is Any (the type of each keyword argument's value), not a Dict wrapper. Fixes mkhorasani#287
pctablet505
marked this pull request as ready for review
July 17, 2026 12:46
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
Authenticate.__init__annotates**kwargsasOptional[Dict[str, Any]]. That's not a valid way to type**kwargs— the annotation on a**kwargsparameter describes the type of each individual value passed in, not the aggregated dict. The correct annotation here isAny.Change
Verified with mypy that this actually removes several spurious downstream errors in the same file (e.g. at the
time.sleep(...)call sites) that were caused bykwargsbeing mistyped, with no new errors introduced.Closes #287