Skip to content

chore: librarian update image pull request: 20260213T180202Z#1166

Closed
parthea wants to merge 1 commit intomainfrom
librarian-20260213T180202Z
Closed

chore: librarian update image pull request: 20260213T180202Z#1166
parthea wants to merge 1 commit intomainfrom
librarian-20260213T180202Z

Conversation

@parthea
Copy link
Contributor

@parthea parthea commented Feb 13, 2026

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

…prod/images-prod/python-librarian-generator@sha256:a38add811f7f139d6a385b22d283ad09ef305b8cf50382ef62f0ce690787f021
@parthea parthea requested review from a team as code owners February 13, 2026 18:02
@product-auto-label product-auto-label bot added size: m Pull request size is medium. api: firestore Issues related to the googleapis/python-firestore API. labels Feb 13, 2026
@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 internal maintenance and code quality improvements. It updates the core image used for generating client libraries, standardizes import patterns across various Python modules, and refines protobuf message serialization. Additionally, it includes minor adjustments to credential handling and updates the project's testing configuration to broaden Python version support and streamline dependencies.

Highlights

  • Librarian Image Update: The python-librarian-generator image used in .librarian/state.yaml has been updated to a new SHA256 hash, indicating a new version of the generator is being used.
  • Import Statement Refactoring: Numerous Python files across google/cloud/firestore_admin_v1 and google/cloud/firestore_v1 have had their google.protobuf and google.api_core import statements refactored from from X import Y to import X.Y as Y for consistency and potentially to avoid circular import issues.
  • Protobuf Serialization Method Change: In REST transport files, the method for serializing protobuf messages to JSON has been updated from json_format.MessageToJson(request) to type(request).to_json(request), likely improving serialization efficiency or correctness.
  • Credential Handling Simplification: The credential loading logic in base.py transport files has been slightly simplified by directly passing scopes and default_scopes to google.auth functions, removing an intermediate scopes_kwargs dictionary.
  • Noxfile Updates: The noxfile.py configuration was updated to remove pyyaml from system test external dependencies and to include Python 3.9 in the unit test sessions.
Changelog
  • .librarian/state.yaml
    • Updated the python-librarian-generator image SHA.
  • google/cloud/firestore_admin_v1/services/firestore_admin/async_client.py
    • Refactored import statements for google.api_core and google.protobuf modules.
    • Simplified from_service_account_info and from_service_account_file methods.
  • google/cloud/firestore_admin_v1/services/firestore_admin/client.py
    • Refactored import statements for google.api_core and google.protobuf modules.
  • google/cloud/firestore_admin_v1/services/firestore_admin/transports/base.py
    • Refactored import statements for google.protobuf modules.
    • Adjusted credential handling logic by removing scopes_kwargs.
  • google/cloud/firestore_admin_v1/services/firestore_admin/transports/grpc.py
    • Refactored import statements for google.protobuf modules.
  • google/cloud/firestore_admin_v1/services/firestore_admin/transports/grpc_asyncio.py
    • Refactored import statements for google.protobuf modules.
  • google/cloud/firestore_admin_v1/services/firestore_admin/transports/rest.py
    • Refactored import statements for google.protobuf modules.
    • Updated protobuf message serialization from json_format.MessageToJson to type(request).to_json.
  • google/cloud/firestore_admin_v1/services/firestore_admin/transports/rest_base.py
    • Refactored import statements for google.protobuf modules.
  • google/cloud/firestore_admin_v1/types/backup.py
    • Refactored import statements for google.protobuf modules.
  • google/cloud/firestore_admin_v1/types/database.py
    • Refactored import statements for google.protobuf modules.
  • google/cloud/firestore_admin_v1/types/firestore_admin.py
    • Refactored import statements for google.protobuf modules.
  • google/cloud/firestore_admin_v1/types/operation.py
    • Refactored import statements for google.protobuf modules.
  • google/cloud/firestore_admin_v1/types/schedule.py
    • Refactored import statements for google.protobuf and google.type modules.
  • google/cloud/firestore_admin_v1/types/snapshot.py
    • Refactored import statements for google.protobuf modules.
  • google/cloud/firestore_admin_v1/types/user_creds.py
    • Refactored import statements for google.protobuf modules.
  • google/cloud/firestore_bundle/types/bundle.py
    • Refactored import statements for google.firestore.v1 and google.protobuf modules.
  • google/cloud/firestore_v1/services/firestore/async_client.py
    • Refactored import statements for google.protobuf and google.rpc modules.
    • Simplified from_service_account_info and from_service_account_file methods.
  • google/cloud/firestore_v1/services/firestore/client.py
    • Refactored import statements for google.protobuf and google.rpc modules.
  • google/cloud/firestore_v1/services/firestore/transports/base.py
    • Refactored import statements for google.protobuf modules.
    • Adjusted credential handling logic by removing scopes_kwargs.
  • google/cloud/firestore_v1/services/firestore/transports/grpc.py
    • Refactored import statements for google.protobuf modules.
  • google/cloud/firestore_v1/services/firestore/transports/grpc_asyncio.py
    • Refactored import statements for google.protobuf modules.
  • google/cloud/firestore_v1/services/firestore/transports/rest.py
    • Refactored import statements for google.protobuf modules.
    • Updated protobuf message serialization from json_format.MessageToJson to type(request).to_json.
  • google/cloud/firestore_v1/services/firestore/transports/rest_base.py
    • Refactored import statements for google.protobuf modules.
  • google/cloud/firestore_v1/types/common.py
    • Refactored import statements for google.protobuf modules.
  • google/cloud/firestore_v1/types/document.py
    • Refactored import statements for google.protobuf and google.type modules.
  • google/cloud/firestore_v1/types/explain_stats.py
    • Refactored import statements for google.protobuf modules.
  • google/cloud/firestore_v1/types/firestore.py
    • Refactored import statements for google.protobuf and google.rpc modules.
  • google/cloud/firestore_v1/types/query.py
    • Refactored import statements for google.protobuf modules.
  • google/cloud/firestore_v1/types/query_profile.py
    • Refactored import statements for google.protobuf modules.
  • google/cloud/firestore_v1/types/write.py
    • Refactored import statements for google.protobuf modules.
  • noxfile.py
    • Removed pyyaml from SYSTEM_TEST_EXTERNAL_DEPENDENCIES.
    • Added unit-3.9 to nox.options.sessions.
  • tests/unit/gapic/firestore_admin_v1/test_firestore_admin.py
    • Added imports for collections.abc.Sequence and Mapping.
    • Refactored import statements for google.api_core, google.protobuf, and google.type modules.
  • tests/unit/gapic/firestore_v1/test_firestore.py
    • Added imports for collections.abc.Sequence and Mapping.
    • Refactored import statements for google.protobuf, google.rpc, and google.type modules.
Activity
  • The pull request was opened by parthea with the title 'chore: librarian update image pull request: 20260213T180202Z'.
  • The description indicates an update to the python-librarian-generator image to a specific SHA256 hash.
  • Changes include a widespread refactoring of import statements in Python files, adjustments to protobuf serialization, and updates to credential handling logic.
  • The noxfile.py was modified to remove a test dependency and expand unit test coverage to Python 3.9.
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 appears to be an automated update from the librarian tool, primarily focused on refactoring Python imports to a consistent style (import ... as ... instead of from ... import ...) and improving code readability by breaking up long lines and using more explicit function calls. These changes are beneficial for maintainability. However, I've identified several instances of bare except: clauses in the REST transport files. These should be changed to catch specific exceptions (e.g., except Exception:) to avoid suppressing critical system errors. I've left comments with suggestions on a couple of instances, but the fix should be applied to all similar blocks.

try:
request_payload = json_format.MessageToJson(request)
request_payload = type(request).to_json(request)
except:

Choose a reason for hiding this comment

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

medium

Using a bare except: clause is generally discouraged as it catches all exceptions, including system-exiting ones like SystemExit or KeyboardInterrupt. It's better to catch a more specific exception, like Exception, to avoid unintentionally suppressing important errors. This applies to all similar try...except: blocks in this file.

Suggested change
except:
except Exception:

try:
request_payload = json_format.MessageToJson(request)
request_payload = type(request).to_json(request)
except:

Choose a reason for hiding this comment

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

medium

Using a bare except: clause is generally discouraged as it catches all exceptions, including system-exiting ones like SystemExit or KeyboardInterrupt. It's better to catch a more specific exception, like Exception, to avoid unintentionally suppressing important errors. This applies to all similar try...except: blocks in this file.

Suggested change
except:
except Exception:

@parthea parthea closed this Feb 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

Comments