Skip to content

chore: librarian update image pull request: 20260325T185910Z#1532

Merged
parthea merged 2 commits intomainfrom
librarian-20260325T185910Z
Mar 25, 2026
Merged

chore: librarian update image pull request: 20260325T185910Z#1532
parthea merged 2 commits intomainfrom
librarian-20260325T185910Z

Conversation

@parthea
Copy link
Contributor

@parthea parthea commented Mar 25, 2026

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

…prod/images-prod/python-librarian-generator@sha256:667c9c407ace8caf2deba85187536df8a091e7b05c78eea63eb01255fe17a8f3
@parthea parthea requested review from a team as code owners March 25, 2026 18:59
@parthea parthea requested a review from gkevinzheng March 25, 2026 18:59
@product-auto-label product-auto-label bot added the size: l Pull request size is large. label Mar 25, 2026
@product-auto-label product-auto-label bot added the api: spanner Issues related to the googleapis/python-spanner API. label Mar 25, 2026
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello, 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 a routine update to the librarian image, which drives the generation of client libraries. Accompanying this update are several code quality improvements and standardization efforts across the Spanner client libraries. These changes include refining import statements, enhancing client request handling for operational methods, improving documentation build processes, and updating dependency constraints. The overall impact is a more robust, maintainable, and user-friendly client library ecosystem.

Highlights

  • Librarian Image Update: The core librarian image used for generating client libraries has been updated to a new SHA256 hash, ensuring the use of the latest generator version.
  • Standardized Import Statements: Numerous Python files across spanner_admin_database_v1, spanner_admin_instance_v1, and spanner_v1 client libraries have had their import statements standardized, changing from from module import sub_module to import module.sub_module as sub_module for better consistency and clarity.
  • Improved Client Request Handling: Client methods for list_operations, get_operation, delete_operation, and cancel_operation in both synchronous and asynchronous clients now gracefully handle None or dictionary inputs for requests, enhancing flexibility and user experience. This includes new flattened operation tests.
  • Enhanced Sphinx Documentation Build: The docs/conf.py file has been updated to include a custom Sphinx warning filter, specifically suppressing 'Bullet list ends without a blank line' warnings to clean up documentation build logs.
  • Credential and API Endpoint Refinements: Client and transport classes received updates to type hints for API endpoints, improved handling of unparseable mTLS endpoints, and explicit passing of scopes during credential loading. An api_audience parameter was also added to transport constructors for advanced authentication flows.
  • Serialization Logic Update: REST transport classes now use type(request).to_json(request) instead of json_format.MessageToJson(request) for request payload serialization, and gRPC transports updated pickle.dumps formatting for better representation.
  • Dependency Constraint Updates: The testing/constraints files for Python 3.10, 3.11, and 3.12 have been updated to include cryptography as a direct dependency. The testing/constraints-3.8.txt file was removed, and testing/constraints-3.9.txt was updated with specific lower bound versions for dependencies.
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.

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 updates import styles for protobuf and IAM modules across the Google Cloud Spanner client libraries, refactors service account credential handling, and enhances API request processing to support None or dictionary inputs with improved type hints. It also introduces an api_audience parameter to client constructors and updates README.rst formatting. The changes include adding cryptography as a dependency and updating constraint files. Review comments point out several instances of duplicate imports and suggest sorting imports for consistency, which should be addressed.

Comment on lines +27 to +32
import logging
import os
import shlex
import sys
import logging
from typing import Any
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 logging module is imported twice. Please remove the duplicate import. It's also good practice to keep imports sorted alphabetically.

Suggested change
import logging
import os
import shlex
import sys
import logging
from typing import Any
import logging
import os
import shlex
import sys
from typing import Any

Comment on lines 52 to +53
from google.longrunning import operations_pb2 # type: ignore
from google.protobuf import duration_pb2 # type: ignore
from google.protobuf import empty_pb2 # type: ignore
from google.protobuf import field_mask_pb2 # type: ignore
from google.protobuf import timestamp_pb2 # type: ignore
import google.longrunning.operations_pb2 as operations_pb2 # type: ignore
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 google.longrunning.operations_pb2 module is imported twice. Please remove the redundant import.

Suggested change
from google.longrunning import operations_pb2 # type: ignore
from google.protobuf import duration_pb2 # type: ignore
from google.protobuf import empty_pb2 # type: ignore
from google.protobuf import field_mask_pb2 # type: ignore
from google.protobuf import timestamp_pb2 # type: ignore
import google.longrunning.operations_pb2 as operations_pb2 # type: ignore
import google.longrunning.operations_pb2 as operations_pb2 # type: ignore

Comment on lines 69 to +70
from google.longrunning import operations_pb2 # type: ignore
from google.protobuf import duration_pb2 # type: ignore
from google.protobuf import empty_pb2 # type: ignore
from google.protobuf import field_mask_pb2 # type: ignore
from google.protobuf import timestamp_pb2 # type: ignore
import google.longrunning.operations_pb2 as operations_pb2 # type: ignore
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 google.longrunning.operations_pb2 module is imported twice. Please remove the redundant import.

Suggested change
from google.longrunning import operations_pb2 # type: ignore
from google.protobuf import duration_pb2 # type: ignore
from google.protobuf import empty_pb2 # type: ignore
from google.protobuf import field_mask_pb2 # type: ignore
from google.protobuf import timestamp_pb2 # type: ignore
import google.longrunning.operations_pb2 as operations_pb2 # type: ignore
import google.longrunning.operations_pb2 as operations_pb2 # type: ignore

Comment on lines 52 to +53
from google.longrunning import operations_pb2 # type: ignore
from google.protobuf import field_mask_pb2 # type: ignore
from google.protobuf import timestamp_pb2 # type: ignore
import google.longrunning.operations_pb2 as operations_pb2 # type: ignore
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 google.longrunning.operations_pb2 module is imported twice. Please remove the redundant import.

Suggested change
from google.longrunning import operations_pb2 # type: ignore
from google.protobuf import field_mask_pb2 # type: ignore
from google.protobuf import timestamp_pb2 # type: ignore
import google.longrunning.operations_pb2 as operations_pb2 # type: ignore
import google.longrunning.operations_pb2 as operations_pb2 # type: ignore

Comment on lines 69 to +70
from google.longrunning import operations_pb2 # type: ignore
from google.protobuf import field_mask_pb2 # type: ignore
from google.protobuf import timestamp_pb2 # type: ignore
import google.longrunning.operations_pb2 as operations_pb2 # type: ignore
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 google.longrunning.operations_pb2 module is imported twice. Please remove the redundant import.

Suggested change
from google.longrunning import operations_pb2 # type: ignore
from google.protobuf import field_mask_pb2 # type: ignore
from google.protobuf import timestamp_pb2 # type: ignore
import google.longrunning.operations_pb2 as operations_pb2 # type: ignore
import google.longrunning.operations_pb2 as operations_pb2 # type: ignore

Comment on lines 66 to +67
from google.longrunning import operations_pb2 # type: ignore
import google.longrunning.operations_pb2 as operations_pb2 # type: ignore
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 google.longrunning.operations_pb2 module is imported twice. Please remove the redundant import.

Suggested change
from google.longrunning import operations_pb2 # type: ignore
import google.longrunning.operations_pb2 as operations_pb2 # type: ignore
import google.longrunning.operations_pb2 as operations_pb2 # type: ignore

Comment on lines 66 to +67
from google.longrunning import operations_pb2 # type: ignore
import google.longrunning.operations_pb2 as operations_pb2 # type: ignore
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 google.longrunning.operations_pb2 module is imported twice. Please remove the redundant import.

Suggested change
from google.longrunning import operations_pb2 # type: ignore
import google.longrunning.operations_pb2 as operations_pb2 # type: ignore
import google.longrunning.operations_pb2 as operations_pb2 # type: ignore

Copy link
Contributor

@chalmerlowe chalmerlowe left a comment

Choose a reason for hiding this comment

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

LGTM

@parthea parthea merged commit e5638ab into main Mar 25, 2026
24 checks passed
@parthea parthea deleted the librarian-20260325T185910Z branch March 25, 2026 21:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api: spanner Issues related to the googleapis/python-spanner API. size: l Pull request size is large.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants