Skip to content

Conversation

@parthea
Copy link
Contributor

@parthea parthea commented Dec 16, 2025

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

Generation failed for

  • google-cloud-bigquery-storage

…prod/images-prod/python-librarian-generator@sha256:b8058df4c45e9a6e07f6b4d65b458d0d059241dd34c814f151c8bf6b89211209
@parthea
Copy link
Contributor Author

parthea commented Dec 16, 2025

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.

@parthea parthea added the do not merge Indicates a pull request not ready for merge, due to either quality or timing. label Dec 16, 2025
@parthea parthea changed the title chore: librarian update image pull request: 20251216T210030Z [WIP] chore: librarian update image pull request: 20251216T210030Z Dec 16, 2025
@gemini-code-assist
Copy link

Summary of Changes

Hello @parthea, 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 primarily focuses on updating the core image used for generating client libraries and enhancing the robustness of the generated code. It introduces comprehensive Python version and dependency checks, refactors mTLS client certificate logic for improved clarity, and removes outdated keyword argument fixup scripts. These changes aim to ensure compatibility with newer Python versions and streamline the client library generation process, although some libraries are temporarily blocked from generation.

Highlights

  • Librarian Image Update: The python-librarian-generator image has been updated to a new SHA256 hash, indicating a refresh of the underlying generation tools.
  • Python Version and Dependency Checks: New logic has been introduced in the __init__.py files across Discovery Engine client libraries to check the Python version and the installed google.protobuf version, issuing FutureWarnings for unsupported or soon-to-be-unsupported environments.
  • mTLS Client Certificate Handling Refactor: The mTLS client certificate handling logic has been refactored across various Discovery Engine service clients. A new static method _use_client_cert_effective() was added to centralize the determination of whether client certificates should be used, improving consistency and maintainability.
  • Removal of Keyword Fixup Scripts: Several fixup_discoveryengine_v*_keywords.py scripts have been removed, suggesting that the issues they addressed (related to positional parameters in client method calls) are either resolved by the updated generator or no longer relevant.
  • Library Generation Blocking: A significant number of Google Cloud libraries have been explicitly marked with generate_blocked: true in .librarian/config.yaml, indicating that automatic generation for these specific libraries is currently being prevented.
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 from the librarian tool updates the generator image and regenerates client libraries. The changes are mostly within the google-cloud-discoveryengine package and its various API versions. Key improvements include adding Python version and dependency checks in __init__.py files, and refactoring mTLS client certificate handling into a shared static method across all service clients, which reduces code duplication. Obsolete fixup scripts have been removed, and unit tests have been updated to cover the new logic.

The changes are generally good and improve the codebase. I've added a few comments on the __init__.py files regarding the use of broad except Exception: clauses in the new version-checking logic. While this is a fallback path, using more specific exceptions would improve maintainability and prevent masking unexpected errors.

version_string: str = metadata.version(dependency_name)
parsed_version = parse_version_to_tuple(version_string)
return (parsed_version, version_string)
except Exception:

Choose a reason for hiding this comment

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

medium

Using a broad except Exception: can mask unexpected errors. The comment mentions PackageNotFoundError, and the parsing logic can raise ValueError. It would be more robust to catch these specific exceptions, for example: except (metadata.PackageNotFoundError, ValueError):. This would make the code's intent clearer and prevent swallowing unrelated errors.

+ f"{_dependency_package}.",
FutureWarning,
)
except Exception:

Choose a reason for hiding this comment

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

medium

Using a broad except Exception: can hide unexpected errors and make debugging difficult. It would be more robust to catch only the specific exceptions that are expected to occur here. This would ensure that unexpected programming errors within the try block are not silently ignored.

version_string: str = metadata.version(dependency_name)
parsed_version = parse_version_to_tuple(version_string)
return (parsed_version, version_string)
except Exception:

Choose a reason for hiding this comment

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

medium

Using a broad except Exception: can mask unexpected errors. The comment mentions PackageNotFoundError, and the parsing logic can raise ValueError. It would be more robust to catch these specific exceptions, for example: except (metadata.PackageNotFoundError, ValueError):. This would make the code's intent clearer and prevent swallowing unrelated errors.

+ f"{_dependency_package}.",
FutureWarning,
)
except Exception:

Choose a reason for hiding this comment

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

medium

Using a broad except Exception: can hide unexpected errors and make debugging difficult. It would be more robust to catch only the specific exceptions that are expected to occur here. This would ensure that unexpected programming errors within the try block are not silently ignored.

parsed_version = parse_version_to_tuple(version_string)
return (parsed_version, version_string)
except Exception:
# Catch exceptions from metadata.version() (e.g., PackageNotFoundError)

Choose a reason for hiding this comment

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

medium

Using a broad except Exception: can mask unexpected errors. The comment mentions PackageNotFoundError, and the parsing logic can raise ValueError. It would be more robust to catch these specific exceptions, for example: except (metadata.PackageNotFoundError, ValueError):. This would make the code's intent clearer and prevent swallowing unrelated errors.

FutureWarning,
)
except Exception:
warnings.warn(

Choose a reason for hiding this comment

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

medium

Using a broad except Exception: can hide unexpected errors and make debugging difficult. It would be more robust to catch only the specific exceptions that are expected to occur here. This would ensure that unexpected programming errors within the try block are not silently ignored.

@parthea parthea closed this Dec 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

do not merge Indicates a pull request not ready for merge, due to either quality or timing.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants