Skip to content

docs(async): mark new AsyncIO APIs as experimental#1533

Open
sinhasubham wants to merge 1 commit intomainfrom
async_exp
Open

docs(async): mark new AsyncIO APIs as experimental#1533
sinhasubham wants to merge 1 commit intomainfrom
async_exp

Conversation

@sinhasubham
Copy link
Contributor

Add experimental warning comments to all async Spanner Python components to inform users that the API is in the beta phase and subject to change.

@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 Mar 26, 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 aims to clearly communicate the experimental nature of the new AsyncIO APIs within the Google Cloud Spanner Python client. By adding explicit warnings, users are informed that these APIs are currently in a beta phase and may undergo modifications, ensuring transparency regarding their stability and readiness for production use. Additionally, minor code style improvements were made in synchronous client files.

Highlights

  • Experimental API Warnings: Added explicit warning comments to all new asynchronous Google Cloud Spanner Python client components, indicating their experimental status and potential for future changes.
  • Code Style Refinements: Applied minor syntax adjustments across several synchronous Spanner Python client files, primarily involving tuple unpacking and formatting for enhanced code readability and consistency.
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 introduces comments to mark several asynchronous API classes as experimental across various modules (e.g., _async/batch.py, _async/client.py, _async/database.py, _async/pool.py, _async/session.py, _async/snapshot.py, _async/streamed.py, _async/transaction.py). Additionally, it updates numerous instances of tuple unpacking and dictionary comprehensions to use explicit parentheses (e.g., a, b = c to (a, b) = c) for improved clarity and consistency across the google/cloud/spanner_v1 directory. No feedback to provide.

@sinhasubham sinhasubham requested a review from olavloite March 26, 2026 09:48
@sinhasubham sinhasubham marked this pull request as ready for review March 26, 2026 09:48
@sinhasubham sinhasubham requested review from a team as code owners March 26, 2026 09:48
DEFAULT_RETRY_TIMEOUT_SECS = 30


# Experimental API - Please note that this API is currently experimental and can change in the future.
Copy link
Contributor

Choose a reason for hiding this comment

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

Normally, this should be part of the docstring so it shows up in IDEs. Now a customer must read the source code to see that this is an experimental API. So it should be something like this:

class Batch(_BatchBase):
    """Accumulate mutations for transmission during :meth:`commit`.
    .. note::
        This API is experimental and subject to breaking changes.
    """

Copy link
Contributor Author

Choose a reason for hiding this comment

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

So the problem with adding this directly to docString is that it will get copied to sync files as well. CrossSync ignores the "#"comments so it easily works this way.

Other way i can think of is by adding a method at the end of async classes to check if this is a async file using "crossSync.is_async" then append the experimental warning to the doc string. Something like:

if CrossSync.is_async:
    if Client.__doc__ is not None:
        Client.__doc__ += "\n\nExperimental API - Please note that this API is currently experimental and can change in the future.\n"

request_options=request_options,
)
call_metadata, error_augmenter = database.with_error_augmentation(
(call_metadata, error_augmenter) = database.with_error_augmentation(
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we move these other changes to a separate PR?



# Experimental API - Please note that this API is currently experimental and can change in the future.
class Client(ClientWithProject):
Copy link
Contributor

Choose a reason for hiding this comment

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

This is the most important class to mark clearly, as this is the main entry point for the async API. Can we add a bit more context to the docstring of this class? So something like this:

.. note::
The Async API is currently experimental and subject to breaking changes. This comment will be removed once the API has stabilized.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure will add

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: m Pull request size is medium.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants