Skip to content

Conversation

@rafi-rr
Copy link

@rafi-rr rafi-rr commented Jul 13, 2025

Fixes #715

  • Tests pass except for timezone tests when running locally
  • For README: Migrated deprecated connection to driver_connection

@product-auto-label product-auto-label bot added the api: spanner Issues related to the googleapis/python-spanner-sqlalchemy API. label Jul 13, 2025
@rafi-rr rafi-rr force-pushed the driver_connection branch from 4734349 to dbbe2ab Compare July 13, 2025 08:56
from google.api_core.client_options import ClientOptions
from google.auth.credentials import AnonymousCredentials
from google.cloud.spanner_v1 import Client, TransactionOptions
from sqlalchemy.exc import NoSuchTableError
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: can you remove the unrelated changes from this pull request (and potentially open a separate pull request for formatting issues, if any)

if dbapi_conn.inside_transaction:
transaction_started = getattr(
dbapi_conn,
"spanner_transaction_started",
Copy link
Contributor

Choose a reason for hiding this comment

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

Note: The name of the property is _spanner_transaction_started.

But I don't think it is wise to make this change at all, or at least not in the way that it is done here. _spanner_transaction_started is a private property, meaning that it could silently be removed or changed at any time. It would be better to continue to rely only on the inside_transaction property, even though it is deprecated, as it is part of the public API.

@rafi-rr
Copy link
Author

rafi-rr commented Aug 11, 2025

Closing this PR as it was intended as a suggestion. I believe the team will make more informed decisions on how to handle the deprecation issue.

@rafi-rr rafi-rr closed this Aug 11, 2025
@rafi-rr rafi-rr deleted the driver_connection branch August 11, 2025 13:04
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-sqlalchemy API.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

_ConnectionFairy.connection attribute is deprecated

2 participants