Skip to content

chore: librarian update image pull request: 20260204T233015Z#15527

Open
ohmayr wants to merge 1 commit intomainfrom
librarian-20260204T233015Z
Open

chore: librarian update image pull request: 20260204T233015Z#15527
ohmayr wants to merge 1 commit intomainfrom
librarian-20260204T233015Z

Conversation

@ohmayr
Copy link
Contributor

@ohmayr ohmayr commented Feb 4, 2026

feat: update image to us-central1-docker.pkg.dev/cloud-sdk-librarian-prod/images-prod/python-librarian-generator@sha256:121325a77939bb0df3e78b84556b166115ec6447dfc174165bb7702d5d2e96eb

Generation failed for

  • google-cloud-binary-authorization
  • google-cloud-containeranalysis
  • google-cloud-gke-hub
  • google-cloud-policytroubleshooter-iam

…prod/images-prod/python-librarian-generator@sha256:121325a77939bb0df3e78b84556b166115ec6447dfc174165bb7702d5d2e96eb
@ohmayr
Copy link
Contributor Author

ohmayr commented Feb 4, 2026

One or more libraries have failed to generate, please review PR description for a list of failed libraries.
For each failed library, open a ticket in that library’s repository and then you may resolve this comment and merge.

@ohmayr ohmayr marked this pull request as ready for review February 4, 2026 23:38
@ohmayr ohmayr requested review from a team as code owners February 4, 2026 23:38
@ohmayr ohmayr requested a review from Linchin February 4, 2026 23:38
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @ohmayr, 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 is a maintenance and code quality update across multiple Google Cloud Python client libraries. It updates the foundational image used for library generation, standardizes Python import statements for google.protobuf and google.api_core modules, and refines JSON serialization logic in REST transports. Additionally, it includes a minor improvement to the documentation build process by filtering out specific Sphinx warnings.

Highlights

  • Librarian Image Update: The core python-librarian-generator image, responsible for generating client libraries, has been updated to a new SHA256 hash (121325a77939bb0df3e78b84556b166115ec6447dfc174165bb7702d5d2e96eb) in .librarian/state.yaml.
  • Python Import Refactoring: Numerous Python files across various Google Cloud client libraries (e.g., Ads AdManager, AI Generative Language, Analytics Admin, Apps Chat, Apps Meet) have had their google.protobuf and google.api_core import statements refactored. The style changed from from X import Y to import X.Y as Y for better consistency and clarity.
  • Sphinx Documentation Warning Filter: Documentation configuration files (docs/conf.py) in several packages were updated to include a logging filter. This filter suppresses 'Bullet list ends without a blank line' warnings during Sphinx documentation builds, leading to cleaner build logs.
  • JSON Serialization Method Update: In several REST transport files (transports/rest.py), the method for serializing messages to JSON was updated from json_format.MessageToJson(request) to type(request).to_json(request), standardizing the serialization approach.
Changelog
  • .librarian/state.yaml
    • Updated the image field to a new SHA256 hash for the python-librarian-generator.
  • packages/*//*.py (various client, async_client, transports, types, and test files)**
    • Refactored import statements for google.protobuf.*_pb2 and google.api_core.* modules from from X import Y to import X.Y as Y.
  • packages/*/docs/conf.py
    • Standardized comment formatting by removing a blank line.
    • Added import logging and from typing import Any.
    • Implemented an UnexpectedUnindentFilter class and a setup function to filter out specific Sphinx warnings related to bullet list formatting, improving documentation build cleanliness.
  • packages/*/transports/rest.py (multiple services)
    • Updated the JSON serialization method from json_format.MessageToJson(request) to type(request).to_json(request).
Activity
  • The pull request was created by ohmayr as an automated chore to update the librarian image and apply generated code changes.
  • The description notes that generation failed for google-cloud-binary-authorization, google-cloud-containeranalysis, google-cloud-gke-hub, and google-cloud-policytroubleshooter-iam, indicating these libraries were not updated in this specific run.
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
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 is an automated update from the librarian tool, which updates the generator image and regenerates numerous client libraries. The changes primarily consist of stylistic improvements to imports and JSON serialization logic, along with adding a Sphinx filter to suppress documentation build warnings. I've identified a recurring issue with the use of bare except: blocks when serializing request payloads. I've left a comment on the first instance of this pattern; this feedback applies to all similar occurrences throughout the pull request. Addressing this would improve the code's robustness. The provided rule regarding except ImportError and type: ignore[assignment] does not apply to these comments, so they are kept as is.

method = transcoded_request["method"]
try:
request_payload = json_format.MessageToJson(request)
request_payload = type(request).to_json(request)
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

While this change to use type(request).to_json(request) is an improvement, the following line uses a bare except:, which is discouraged. A bare except catches all exceptions, including system-exiting ones like SystemExit and KeyboardInterrupt, which can hide critical bugs and make debugging difficult. It is recommended to catch a more specific exception, such as except Exception:. This feedback applies to all similar try...except blocks modified in this pull request.

method = transcoded_request["method"]
try:
request_payload = json_format.MessageToJson(request)
request_payload = type(request).to_json(request)
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

The following line uses a bare except:, which is discouraged. A bare except catches all exceptions, including system-exiting ones like SystemExit and KeyboardInterrupt, which can hide critical bugs and make debugging difficult. It is recommended to catch a more specific exception, such as except Exception:. This feedback applies to all similar try...except blocks modified in this pull request.

method = transcoded_request["method"]
try:
request_payload = json_format.MessageToJson(request)
request_payload = type(request).to_json(request)
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

The following line uses a bare except:, which is discouraged. A bare except catches all exceptions, including system-exiting ones like SystemExit and KeyboardInterrupt, which can hide critical bugs and make debugging difficult. It is recommended to catch a more specific exception, such as except Exception:. This feedback applies to all similar try...except blocks modified in this pull request.

method = transcoded_request["method"]
try:
request_payload = json_format.MessageToJson(request)
request_payload = type(request).to_json(request)
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

The following line uses a bare except:, which is discouraged. A bare except catches all exceptions, including system-exiting ones like SystemExit and KeyboardInterrupt, which can hide critical bugs and make debugging difficult. It is recommended to catch a more specific exception, such as except Exception:. This feedback applies to all similar try...except blocks modified in this pull request.

method = transcoded_request["method"]
try:
request_payload = json_format.MessageToJson(request)
request_payload = type(request).to_json(request)
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

The following line uses a bare except:, which is discouraged. A bare except catches all exceptions, including system-exiting ones like SystemExit and KeyboardInterrupt, which can hide critical bugs and make debugging difficult. It is recommended to catch a more specific exception, such as except Exception:. This feedback applies to all similar try...except blocks modified in this pull request.

Copy link
Contributor

@daniel-sanche daniel-sanche left a comment

Choose a reason for hiding this comment

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

LGTM

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.

2 participants