You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
refactor(spanner): decouple DB-API TransactionRetryHelper and Cursor #19143
In google.cloud.spanner_dbapi, TransactionRetryHelper (transaction_helper.py) and Cursor (cursor.py) currently have bidirectional coupling:
cursor.py imports CursorStatementType from transaction_helper.py.
transaction_helper.py must import Cursor and Connection under if TYPE_CHECKING: to avoid circular imports, while creating retry cursors via self._connection.cursor() and accessing private Cursor attributes (_in_retry_mode, _timeout, _itr, _result_set, _batch_dml_rows_count, _row_count).
Proposed Cleanup
Break the circular dependency between transaction_helper.py and cursor.py (for example, by separating shared statement/result types or delegating statement replay through self-contained retriable statement objects rather than mutating private Cursor internals from TransactionRetryHelper).
Activity