Skip to content

Commit db62c3a

Browse files
Copilotasmyasnikov
andcommitted
Add error handling for unknown transaction modes in TransactionSettings.to_proto()
Co-authored-by: asmyasnikov <[email protected]>
1 parent aa806c4 commit db62c3a

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

ydb/_grpc/grpcwrapper/ydb_query.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ def to_proto(self) -> ydb_query_pb2.TransactionSettings:
8181
return ydb_query_pb2.TransactionSettings(stale_read_only=self.tx_mode.to_proto())
8282
if self.tx_mode.name == "snapshot_read_write":
8383
return ydb_query_pb2.TransactionSettings(snapshot_read_write=self.tx_mode.to_proto())
84+
raise ValueError(f"Unknown transaction mode: {self.tx_mode.name}")
8485

8586

8687
@dataclass

0 commit comments

Comments
 (0)