GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — feat(spanner): log client configuration at startup by sinhasubham · Pull Request #1461 · googleapis/python-spanner

This repository was archived by the owner on Jun 8, 2026. It is now read-only.

Conversation

@sinhasubham

@sinhasubham sinhasubham commented Dec 9, 2025

Copy link
Copy Markdown
Contributor

This change introduces logging for Spanner client options upon initialization.

This allows customers to easily capture and inspect the configuration being used, which is valuable for debugging and verification.

This feature mirrors the existing logSpannerOptions functionality in the Java client, improving consistency across client libraries. googleapis/java-spanner#4141

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@sinhasubham
sinhasubham requested review from a team December 9, 2025 12:26
@blunderbuss-gcf blunderbuss-gcf Bot assigned bhatt4982 Dec 9, 2025
@product-auto-label product-auto-label Bot added size: m Pull request size is medium. api: spanner Issues related to the googleapis/python-spanner API. labels Dec 9, 2025
@gemini-code-assist

gemini-code-assist Bot commented Dec 9, 2025

Copy link
Copy Markdown
Contributor

Summary of Changes

Hello @sinhasubham, 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 introduces a new feature to the Spanner client library that logs its configuration details upon initialization. This enhancement aims to improve the user experience by providing immediate and clear insight into the client's operational parameters, which is invaluable for diagnosing issues and confirming desired settings. The change also contributes to greater consistency across Google Cloud client libraries by mirroring functionality already present in the Java Spanner client.

Highlights

  • Client Configuration Logging: Implemented logging of Spanner client options during initialization to provide immediate visibility into the client's setup.
  • Enhanced Debugging and Verification: Enables easier debugging and verification of client configurations for users by exposing critical setup parameters.
  • Cross-Client Consistency: Aligns the Python client's behavior with the existing logSpannerOptions functionality found in the Java client library, promoting consistency across client ecosystems.
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. ↩

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

gemini-code-assist[bot]
gemini-code-assist Bot reviewed Dec 9, 2025
View reviewed changes

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this 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 introduces logging for Spanner client options at startup, which is a great enhancement for debuggability. The implementation is mostly solid, and the tests are comprehensive. However, I've found a critical bug due to a function name typo that will cause a NameError on client initialization. I've also provided a suggestion to improve the clarity of the host resolution logic. Once the critical issue is addressed, this will be a valuable addition.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread google/cloud/spanner_v1/client.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread google/cloud/spanner_v1/client.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

@sinhasubham
sinhasubham force-pushed the fix/init-logs branch 2 times, most recently from a242170 to c4eecec Compare December 11, 2025 11:28
surbhigarg92
surbhigarg92 reviewed Dec 15, 2025
View reviewed changes
Comment thread google/cloud/spanner_v1/client.py Outdated
Comment on lines +300 to +305
if self._emulator_host:
host = self._emulator_host
elif self._experimental_host:
host = self._experimental_host
elif self._client_options and self._client_options.api_endpoint:
host = self._client_options.api_endpoint

@surbhigarg92 surbhigarg92 Dec 15, 2025

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Emulator host must be getting set somewhere else in the client object, Can't we reuse it ?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@sinhasubham sinhasubham Dec 19, 2025

Copy link
Copy Markdown
Contributor Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

I could't find emulator already getting set anywhere already but i have moved this logic to client init and added the host value in client object for future reusability.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@sinhasubham
sinhasubham force-pushed the fix/init-logs branch from c4eecec to ae9d626 Compare December 18, 2025 16:37
sakthivelmanii
sakthivelmanii reviewed Dec 19, 2025
View reviewed changes
Comment thread google/cloud/spanner_v1/client.py

self._log_spanner_options()

def _log_spanner_options(self):

@sakthivelmanii sakthivelmanii Dec 19, 2025

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

We have decided not to enable it by default in Go and Node. We should follow the similar approach here. It can enabled through ENV.

@surbhigarg92 your thoughts here?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@surbhigarg92 surbhigarg92 Dec 19, 2025

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

sure, lets do the same. We have already received customer issues in Node and Go. Add it behind a ENV same as Go. I feel only one ENV is enough GOOGLE_CLOUD_SPANNER_ENABLE_LOG_CLIENT_OPTIONS

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

sinhasubham reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

@sinhasubham sinhasubham Dec 23, 2025

Copy link
Copy Markdown
Contributor Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Done. Added new env variable as a control to client options logging.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@sinhasubham
sinhasubham force-pushed the fix/init-logs branch 3 times, most recently from 5939f67 to b982440 Compare January 8, 2026 09:50
sinhasubham added 2 commits January 8, 2026 15:22
@sinhasubham
feat(spanner): log client configuration at startup
f33cbe1
@sinhasubham
feat(spanner): add env variable to enable client options logging
cbdea55
@sinhasubham
sinhasubham force-pushed the fix/init-logs branch from b982440 to cbdea55 Compare January 8, 2026 09:52
@chalmerlowe

chalmerlowe commented Mar 2, 2026

Copy link
Copy Markdown
Contributor

Migration Notice: This library is moving to the google-cloud-python monorepo soon.

We closed this PR due to inactivity to ensure a clean migration. Please re-open this work in the new monorepo once the migration is complete!

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@chalmerlowe chalmerlowe closed this Mar 2, 2026
@sinhasubham sinhasubham mentioned this pull request May 12, 2026
feat(spanner): log client configuration at startup googleapis/google-cloud-python#17040
Merged
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Reviewers

3 more reviewers
@surbhigarg92 surbhigarg92 surbhigarg92 left review comments
@gemini-code-assist gemini-code-assist[bot] gemini-code-assist[bot] left review comments
@sakthivelmanii sakthivelmanii sakthivelmanii left review comments
Reviewers whose approvals may not affect merge requirements

Uh oh!

There was an error while loading. Please reload this page.

Assignees

@bhatt4982 bhatt4982

Labels

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

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

5 participants

@sinhasubham @chalmerlowe @surbhigarg92 @sakthivelmanii @bhatt4982
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.