Skip to content

Conversation

@Pulkit0110
Copy link
Member

Add support for partial list buckets

@Pulkit0110 Pulkit0110 requested review from a team as code owners November 10, 2025 03:42
@product-auto-label product-auto-label bot added the size: m Pull request size is medium. label Nov 10, 2025
@product-auto-label product-auto-label bot added the api: storage Issues related to the googleapis/python-storage API. label Nov 10, 2025
@gemini-code-assist
Copy link

Summary of Changes

Hello @Pulkit0110, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request enhances the list_buckets functionality within the Google Cloud Storage client library by introducing support for partial success scenarios. Users can now opt to receive a list of unreachable buckets alongside successfully listed ones, providing more comprehensive information when some buckets are unavailable. This improves the robustness and error handling capabilities of the bucket listing operation by allowing clients to be aware of and handle partially failed requests.

Highlights

  • New Feature: Partial Success for List Buckets: Introduced a new optional parameter return_partial_success to the Client.list_buckets method.
  • Handling Unreachable Buckets: When return_partial_success is set to True, the returned iterator will now include an unreachable attribute, which is a list of buckets that could not be listed successfully.
  • Internal Helper Function: A new private function _buckets_page_start was added to process and collect unreachable buckets from the API response during pagination.
  • Unit Testing: A new unit test test_list_buckets_w_partial_success has been added to ensure the correct functionality and integration of the partial success feature.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link

@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 support for partial success in list_buckets, which is a valuable addition. However, I've found a couple of critical issues that need to be addressed before this can be merged. There's an indentation error in a new helper function that will cause a runtime failure, and the new unit test is broken due to an incorrect mock setup and is also incomplete. I've also identified an opportunity to refactor the list_buckets method to reduce code duplication, which will improve maintainability.

@chandra-siri
Copy link
Contributor

@Pulkit0110 Also include system tests. (Which can be done by hitting storage testbench)

@Pulkit0110
Copy link
Member Author

@Pulkit0110 Also include system tests. (Which can be done by hitting storage testbench)

Maybe I'll do it in a separate PR as system tests can be written only after the PRs for testbench are merged.

@Pulkit0110 Pulkit0110 added the owlbot:run Add this label to trigger the Owlbot post processor. label Nov 12, 2025
@gcf-owl-bot gcf-owl-bot bot removed the owlbot:run Add this label to trigger the Owlbot post processor. label Nov 12, 2025
@Pulkit0110 Pulkit0110 merged commit 92fc2b0 into googleapis:main Nov 12, 2025
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api: storage Issues related to the googleapis/python-storage API. size: m Pull request size is medium.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants