Skip to content

chore(storage): improve type annotations in client and bucket modules#16623

Open
bautsi wants to merge 2 commits intogoogleapis:mainfrom
bautsi:chore/storage-add-typing
Open

chore(storage): improve type annotations in client and bucket modules#16623
bautsi wants to merge 2 commits intogoogleapis:mainfrom
bautsi:chore/storage-add-typing

Conversation

@bautsi
Copy link
Copy Markdown

@bautsi bautsi commented Apr 13, 2026

This PR adds type annotations to selected methods in the storage client and bucket modules to improve developer experience and static analysis support.

Includes:

  • google.cloud.storage.Bucket.blob()
  • google.cloud.storage.Bucket.get_blob()
  • google.cloud.storage.Client.get_bucket()
  • google.cloud.storage.Client.create_bucket()

No runtime behavior is changed.

Partially addresses #15969

@bautsi bautsi requested a review from a team as a code owner April 13, 2026 04:00
Copy link
Copy Markdown
Contributor

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

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 introduces type annotations to the bucket and client modules. The review feedback highlights that the current implementation of these hints causes circular dependencies and runtime NameErrors. The reviewer suggests using string literals for type hints and utilizing TYPE_CHECKING blocks to resolve these issues.

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.

1 participant