Skip to content

chore: librarian update image pull request: 20260219T183840Z#1172

Merged
parthea merged 2 commits intomainfrom
librarian-20260219T183840Z
Feb 19, 2026
Merged

chore: librarian update image pull request: 20260219T183840Z#1172
parthea merged 2 commits intomainfrom
librarian-20260219T183840Z

Conversation

@parthea
Copy link
Contributor

@parthea parthea commented Feb 19, 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 19, 2026 18:38
@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 19, 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 updates the python-librarian-generator image used for generating client libraries. It also includes a significant refactoring of Python import statements across the Firestore client libraries, standardizing them to use import X as X syntax. Additionally, minor adjustments were made to client initialization methods and JSON serialization logic within the REST transports, with accompanying updates to the unit tests.

Highlights

  • Librarian Image Update: The python-librarian-generator Docker image reference in .librarian/state.yaml has been updated to a new SHA256 hash.
  • Python Import Style Refactoring: Numerous Python files across firestore_admin_v1 and firestore_v1 services and types have had their from google.protobuf import X_pb2 style imports changed to import google.protobuf.X_pb2 as X_pb2.
  • Client Factory Method Refactoring: The from_service_account_info and from_service_account_file methods in async_client.py for both firestore_admin_v1 and firestore_v1 were refactored to explicitly pass credential arguments and use a temporary variable for __func__ access.
  • JSON Serialization Update: The method for serializing request payloads to JSON in rest.py files for both firestore_admin_v1 and firestore_v1 has been updated from json_format.MessageToJson(request) to type(request).to_json(request).
  • Unit Test Updates: Corresponding unit test files for firestore_admin_v1 and firestore_v1 were updated to reflect the import style changes and include new imports from collections.abc.
Changelog
  • .librarian/generator-input/librarian.py
    • Updated import statements for Firestore bundle types.
  • .librarian/state.yaml
    • Updated the Python Librarian generator image reference.
  • google/cloud/firestore_admin_v1/services/firestore_admin/async_client.py
    • Refactored import statements.
    • Refactored client factory methods to explicitly pass credential arguments.
  • google/cloud/firestore_admin_v1/services/firestore_admin/client.py
    • Refactored import statements.
  • google/cloud/firestore_admin_v1/services/firestore_admin/transports/base.py
    • Refactored import statements.
    • Updated credential handling logic to explicitly pass scopes.
  • google/cloud/firestore_admin_v1/services/firestore_admin/transports/grpc.py
    • Refactored import statements.
  • google/cloud/firestore_admin_v1/services/firestore_admin/transports/grpc_asyncio.py
    • Refactored import statements.
  • google/cloud/firestore_admin_v1/services/firestore_admin/transports/rest.py
    • Refactored import statements.
    • Updated JSON serialization method from json_format.MessageToJson to type(request).to_json.
  • google/cloud/firestore_admin_v1/services/firestore_admin/transports/rest_base.py
    • Refactored import statements.
  • google/cloud/firestore_admin_v1/types/backup.py
    • Refactored import statements.
  • google/cloud/firestore_admin_v1/types/database.py
    • Refactored import statements.
  • google/cloud/firestore_admin_v1/types/firestore_admin.py
    • Refactored import statements.
  • google/cloud/firestore_admin_v1/types/operation.py
    • Refactored import statements.
  • google/cloud/firestore_admin_v1/types/schedule.py
    • Refactored import statements.
  • google/cloud/firestore_admin_v1/types/snapshot.py
    • Refactored import statements.
  • google/cloud/firestore_admin_v1/types/user_creds.py
    • Refactored import statements.
  • google/cloud/firestore_bundle/types/bundle.py
    • Refactored import statements.
  • google/cloud/firestore_v1/services/firestore/async_client.py
    • Refactored import statements.
    • Refactored client factory methods to explicitly pass credential arguments.
  • google/cloud/firestore_v1/services/firestore/client.py
    • Refactored import statements.
  • google/cloud/firestore_v1/services/firestore/transports/base.py
    • Refactored import statements.
    • Updated credential handling logic to explicitly pass scopes.
  • google/cloud/firestore_v1/services/firestore/transports/grpc.py
    • Refactored import statements.
  • google/cloud/firestore_v1/services/firestore/transports/grpc_asyncio.py
    • Refactored import statements.
  • google/cloud/firestore_v1/services/firestore/transports/rest.py
    • Refactored import statements.
    • Updated JSON serialization method from json_format.MessageToJson to type(request).to_json.
  • google/cloud/firestore_v1/services/firestore/transports/rest_base.py
    • Refactored import statements.
  • google/cloud/firestore_v1/types/common.py
    • Refactored import statements.
  • google/cloud/firestore_v1/types/document.py
    • Refactored import statements.
  • google/cloud/firestore_v1/types/explain_stats.py
    • Refactored import statements.
  • google/cloud/firestore_v1/types/firestore.py
    • Refactored import statements.
  • google/cloud/firestore_v1/types/query.py
    • Refactored import statements.
  • google/cloud/firestore_v1/types/query_profile.py
    • Refactored import statements.
  • google/cloud/firestore_v1/types/write.py
    • Refactored import statements.
  • tests/unit/gapic/firestore_admin_v1/test_firestore_admin.py
    • Updated imports to reflect new style.
    • Added imports for collections.abc.Sequence and Mapping.
  • tests/unit/gapic/firestore_v1/test_firestore.py
    • Updated imports to reflect new style.
    • Added imports for collections.abc.Sequence and Mapping.
Activity
  • This pull request was automatically generated by the Librarian system to update the python-librarian-generator image and apply subsequent code changes.
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.

@parthea parthea added kokoro:run Add this label to force Kokoro to re-run the tests. kokoro:force-run Add this label to force Kokoro to re-run the tests. labels Feb 19, 2026
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 updates the librarian generator image and applies the resulting code changes. The changes mainly consist of updating import styles and refactoring some code for better readability. I've identified several instances of bare except: clauses, which are not best practice and could lead to unexpected behavior. I've left comments with suggestions to make the exception handling more specific.

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 can catch unexpected exceptions like SystemExit or KeyboardInterrupt. It's better to catch a more specific exception, like Exception.

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 can catch unexpected exceptions like SystemExit or KeyboardInterrupt. It's better to catch a more specific exception, like Exception.

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 can catch unexpected exceptions like SystemExit or KeyboardInterrupt. It's better to catch a more specific exception, like Exception.

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 can catch unexpected exceptions like SystemExit or KeyboardInterrupt. It's better to catch a more specific exception, like Exception.

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 can catch unexpected exceptions like SystemExit or KeyboardInterrupt. It's better to catch a more specific exception, like Exception.

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 can catch unexpected exceptions like SystemExit or KeyboardInterrupt. It's better to catch a more specific exception, like Exception.

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 can catch unexpected exceptions like SystemExit or KeyboardInterrupt. It's better to catch a more specific exception, like Exception.

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 can catch unexpected exceptions like SystemExit or KeyboardInterrupt. It's better to catch a more specific exception, like Exception.

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 can catch unexpected exceptions like SystemExit or KeyboardInterrupt. It's better to catch a more specific exception, like Exception.

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 can catch unexpected exceptions like SystemExit or KeyboardInterrupt. It's better to catch a more specific exception, like Exception.

Suggested change
except:
except Exception:

@yoshi-kokoro yoshi-kokoro removed kokoro:run Add this label to force Kokoro to re-run the tests. kokoro:force-run Add this label to force Kokoro to re-run the tests. labels Feb 19, 2026
@parthea parthea enabled auto-merge (squash) February 19, 2026 20:33
@parthea parthea merged commit 8cdb37d into main Feb 19, 2026
24 of 25 checks passed
@parthea parthea deleted the librarian-20260219T183840Z branch February 19, 2026 21:25
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.

3 participants

Comments