Skip to content

fix(google-auth): fix TYPE_CHECKING imports in _default.py - #19078

Open
sakshamgoyal-01 wants to merge 1 commit into
googleapis:mainfrom
sakshamgoyal-01:fix/google-auth-default-type-checking
Open

sakshamgoyal-01 wants to merge 1 commit into
googleapis:mainfrom
sakshamgoyal-01:fix/google-auth-default-type-checking

Conversation

@sakshamgoyal-01

Copy link
Copy Markdown

Fixes #19077

(Note: This is an AI-generated PR.)

Import google.auth.credentials and google.auth.transport modules instead of the Credentials and Request classes in google/auth/_default.py's TYPE_CHECKING block so type checkers (e.g., Pyright / BasedPyright) can resolve google.auth.default()'s parameter and return types instead of treating them as Unknown.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates the type checking imports in packages/google-auth/google/auth/_default.py to import the google.auth.credentials and google.auth.transport modules directly, rather than importing specific classes with type-ignore comments. There are no review comments, so I have no additional feedback to provide.

@sakshamgoyal-01
sakshamgoyal-01 marked this pull request as ready for review November 13, 2026 20:49
@sakshamgoyal-01
sakshamgoyal-01 requested review from a team as code owners November 13, 2026 20:49

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(google-auth): invalid TYPE_CHECKING imports in google/auth/_default.py cause Unknown types in Pyright

1 participant