Skip to content

Commit

Permalink
Stop using a non-public grpcio API in Spanner tests. (#4620)
Browse files Browse the repository at this point in the history
Fixes #4580.
  • Loading branch information
dhermes authored Dec 19, 2017
1 parent 4f2c977 commit 2edd612
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions spanner/tests/unit/test_session.py
Original file line number Diff line number Diff line change
Expand Up @@ -899,16 +899,17 @@ def begin_transaction(self, session, options_, options=None):
def _trailing_metadata(self):
from google.protobuf.duration_pb2 import Duration
from google.rpc.error_details_pb2 import RetryInfo
from grpc._common import to_cygrpc_metadata

if self._commit_abort_retry_nanos is None:
return to_cygrpc_metadata(())
return []

retry_info = RetryInfo(
retry_delay=Duration(
seconds=self._commit_abort_retry_seconds,
nanos=self._commit_abort_retry_nanos))
return to_cygrpc_metadata([
('google.rpc.retryinfo-bin', retry_info.SerializeToString())])
return [
('google.rpc.retryinfo-bin', retry_info.SerializeToString()),
]

def commit(self, session, mutations,
transaction_id='', single_use_transaction=None, options=None):
Expand Down

0 comments on commit 2edd612

Please sign in to comment.