Skip to content
This repository was archived by the owner on Mar 13, 2026. It is now read-only.

Commit f494787

Browse files
committed
fix: convert unspecified to serializable
1 parent 8addfb2 commit f494787

2 files changed

Lines changed: 7 additions & 1 deletion

File tree

google/cloud/sqlalchemy_spanner/requirements.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,10 @@ def get_isolation_levels(self, _):
102102
Returns:
103103
dict: isolation levels description.
104104
"""
105-
return {"default": "SERIALIZABLE", "supported": ["SERIALIZABLE", "AUTOCOMMIT"]}
105+
return {
106+
"default": "SERIALIZABLE",
107+
"supported": ["SERIALIZABLE", "REPEATABLE READ", "AUTOCOMMIT"],
108+
}
106109

107110
@property
108111
def precision_numerics_enotation_large(self):

google/cloud/sqlalchemy_spanner/sqlalchemy_spanner.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -813,6 +813,9 @@ def default_isolation_level(self):
813813

814814
@default_isolation_level.setter
815815
def default_isolation_level(self, value):
816+
unspecified = TransactionOptions.IsolationLevel.ISOLATION_LEVEL_UNSPECIFIED
817+
if value == unspecified or value == unspecified.name:
818+
value = "SERIALIZABLE"
816819
self._default_isolation_level = value
817820

818821
def _check_unicode_returns(self, connection, additional_tests=None):

0 commit comments

Comments
 (0)