Skip to content

Commit 081a234

Browse files
committed
updated sync code
1 parent 49c7059 commit 081a234

File tree

3 files changed

+16
-15
lines changed

3 files changed

+16
-15
lines changed

google/cloud/bigtable/data/execute_query/_sync_autogen/execute_query_iterator.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -59,13 +59,11 @@ def __init__(
5959
client: bigtable client
6060
instance_id: id of the instance on which the query is executed
6161
request_body: dict representing the body of the ExecuteQueryRequest
62-
attempt_timeout: the time budget for the entire operation, in seconds.
63-
Failed requests will be retried within the budget.
64-
Defaults to 600 seconds.
65-
operation_timeout: the time budget for an individual network request, in seconds.
62+
attempt_timeout: the time budget for an individual network request, in seconds.
6663
If it takes longer than this time to complete, the request will be cancelled with
6764
a DeadlineExceeded exception, and a retry will be attempted.
68-
Defaults to the 20 seconds. If None, defaults to operation_timeout.
65+
operation_timeout: the time budget for the entire operation, in seconds.
66+
Failed requests will be retried within the budget
6967
req_metadata: metadata used while sending the gRPC request
7068
retryable_excs: a list of errors that will be retried if encountered.
7169
Raises:

tests/system/data/test_system_autogen.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ class TestSystem:
7575
@pytest.fixture(scope="session")
7676
def client(self):
7777
project = os.getenv("GOOGLE_CLOUD_PROJECT") or None
78-
with CrossSync._Sync_Impl.DataClient(project=project, pool_size=4) as client:
78+
with CrossSync._Sync_Impl.DataClient(project=project) as client:
7979
yield client
8080

8181
@pytest.fixture(scope="session")

tests/unit/data/_sync_autogen/test_client.py

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -334,15 +334,18 @@ def test__manage_channel_sleeps(self, refresh_interval, num_cycles, expected_sle
334334
]
335335
client = self._make_client(project="project-id")
336336
client.transport._grpc_channel = channel
337-
try:
338-
if refresh_interval is not None:
339-
client._manage_channel(
340-
refresh_interval, refresh_interval, grace_period=0
341-
)
342-
else:
343-
client._manage_channel(grace_period=0)
344-
except asyncio.CancelledError:
345-
pass
337+
with mock.patch.object(
338+
client.transport, "create_channel", CrossSync._Sync_Impl.Mock
339+
):
340+
try:
341+
if refresh_interval is not None:
342+
client._manage_channel(
343+
refresh_interval, refresh_interval, grace_period=0
344+
)
345+
else:
346+
client._manage_channel(grace_period=0)
347+
except asyncio.CancelledError:
348+
pass
346349
assert sleep.call_count == num_cycles
347350
total_sleep = sum([call[0][1] for call in sleep.call_args_list])
348351
assert (

0 commit comments

Comments
 (0)