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

Commit 7e27dc7

Browse files
committed
Fixed docstrings and skipped system tests on emulator.
1 parent 96d51cf commit 7e27dc7

10 files changed

Lines changed: 53 additions & 37 deletions

File tree

google/cloud/bigtable/backup.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ def size_bytes(self):
226226
def state(self):
227227
"""The current state of this Backup.
228228
229-
:rtype: :class:`~google.cloud.bigtable.admin_v2.types.table.Backup.State`
229+
:rtype: :class:`~google.cloud.bigtable_admin_v2.types.table.Backup.State`
230230
:returns: The current state of this Backup.
231231
"""
232232
return self._state
@@ -342,7 +342,7 @@ def get(self):
342342
"""Retrieves metadata of a pending or completed Backup.
343343
344344
:returns: An instance of
345-
:class:`~google.cloud.bigtable.admin_v2.types.Backup`
345+
:class:`~google.cloud.bigtable_admin_v2.types.Backup`
346346
347347
:raises google.api_core.exceptions.GoogleAPICallError: If the request
348348
failed for any reason.

google/cloud/bigtable_admin_v2/overlay/services/bigtable_table_admin/async_client.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -144,15 +144,15 @@ async def restore_table(
144144
) -> async_restore_table.AsyncRestoreTableOperation:
145145
r"""Create a new table by restoring from a completed backup. The
146146
returned table :class:`long-running operation
147-
<google.cloud.bigtable.admin_v2.overlay.types.restore_table.RestoreTableOperation>`
147+
<google.cloud.bigtable_admin_v2.overlay.types.restore_table.RestoreTableOperation>`
148148
can be used to track the progress of the operation, and to cancel it. The
149149
:attr:`metadata <google.api_core.operation.Operation.metadata>` field type is
150-
:class:`RestoreTableMetadata <google.cloud.bigtable.admin_v2.types.RestoreTableMetadata>`.
150+
:class:`RestoreTableMetadata <google.cloud.bigtable_admin_v2.types.RestoreTableMetadata>`.
151151
The :meth:`response <google.api_core.operation.Operation.result>` type is
152-
:class:`google.cloud.bigtable.admin_v2.types.Table`, if successful.
152+
:class:`google.cloud.bigtable_admin_v2.types.Table`, if successful.
153153
154-
Additionally, the returned :class:`long-running-operation <google.cloud.bigtable.admin_v2.overlay.types.async_restore_table.AsyncRestoreTableOperation>`
155-
provides a method, :meth:`google.cloud.bigtable.admin_v2.overlay.types.async_restore_table.AsyncRestoreTableOperation.optimize_restore_table_operation` that
154+
Additionally, the returned :class:`long-running-operation <google.cloud.bigtable_admin_v2.overlay.types.async_restore_table.AsyncRestoreTableOperation>`
155+
provides a method, :meth:`google.cloud.bigtable_admin_v2.overlay.types.async_restore_table.AsyncRestoreTableOperation.optimize_restore_table_operation` that
156156
provides access to a :class:`google.api_core.operation_async.AsyncOperation` object representing the OptimizeRestoreTable long-running-operation
157157
after the current one has completed.
158158
@@ -197,7 +197,7 @@ async def sample_restore_table():
197197
response = await optimize_operation.result()
198198
199199
Args:
200-
request (Union[google.cloud.bigtable.admin_v2.types.RestoreTableRequest, dict]):
200+
request (Union[google.cloud.bigtable_admin_v2.types.RestoreTableRequest, dict]):
201201
The request object. The request for
202202
[RestoreTable][google.bigtable.admin.v2.BigtableTableAdmin.RestoreTable].
203203
retry (google.api_core.retry.Retry): Designation of what errors, if any,
@@ -209,10 +209,10 @@ async def sample_restore_table():
209209
be of type `bytes`.
210210
211211
Returns:
212-
google.cloud.bigtable.admin_v2.overlay.types.async_restore_table.AsyncRestoreTableOperation:
212+
google.cloud.bigtable_admin_v2.overlay.types.async_restore_table.AsyncRestoreTableOperation:
213213
An object representing a long-running operation.
214214
215-
The result type for the operation will be :class:`google.cloud.bigtable.admin_v2.types.Table` A collection of user data indexed by row, column, and timestamp.
215+
The result type for the operation will be :class:`google.cloud.bigtable_admin_v2.types.Table` A collection of user data indexed by row, column, and timestamp.
216216
Each table is served using the resources of its
217217
parent cluster.
218218
"""
@@ -273,7 +273,7 @@ async def sample_wait_for_consistency():
273273
print(response)
274274
275275
Args:
276-
request (Union[google.cloud.bigtable.admin_v2.overlay.types.WaitForConsistencyRequest, dict]):
276+
request (Union[google.cloud.bigtable_admin_v2.overlay.types.WaitForConsistencyRequest, dict]):
277277
The request object.
278278
name (str):
279279
Required. The unique name of the Table for which to

google/cloud/bigtable_admin_v2/overlay/services/bigtable_table_admin/client.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -144,15 +144,15 @@ def restore_table(
144144
) -> restore_table.RestoreTableOperation:
145145
r"""Create a new table by restoring from a completed backup. The
146146
returned table :class:`long-running operation
147-
<google.cloud.bigtable.admin_v2.overlay.types.restore_table.RestoreTableOperation>`
147+
<google.cloud.bigtable_admin_v2.overlay.types.restore_table.RestoreTableOperation>`
148148
can be used to track the progress of the operation, and to cancel it. The
149149
:attr:`metadata <google.api_core.operation.Operation.metadata>` field type is
150-
:class:`RestoreTableMetadata <google.cloud.bigtable.admin_v2.types.RestoreTableMetadata>`.
150+
:class:`RestoreTableMetadata <google.cloud.bigtable_admin_v2.types.RestoreTableMetadata>`.
151151
The :meth:`response <google.api_core.operation.Operation.result>` type is
152-
:class:`google.cloud.bigtable.admin_v2.types.Table`, if successful.
152+
:class:`google.cloud.bigtable_admin_v2.types.Table`, if successful.
153153
154-
Additionally, the returned :class:`long-running-operation <google.cloud.bigtable.admin_v2.overlay.types.restore_table.RestoreTableOperation>`
155-
provides a method, :meth:`google.cloud.bigtable.admin_v2.overlay.types.restore_table.RestoreTableOperation.optimize_restore_table_operation` that
154+
Additionally, the returned :class:`long-running-operation <google.cloud.bigtable_admin_v2.overlay.types.restore_table.RestoreTableOperation>`
155+
provides a method, :meth:`google.cloud.bigtable_admin_v2.overlay.types.restore_table.RestoreTableOperation.optimize_restore_table_operation` that
156156
provides access to a :class:`google.api_core.operation.Operation` object representing the OptimizeRestoreTable long-running-operation
157157
after the current one has completed.
158158
@@ -197,7 +197,7 @@ def sample_restore_table():
197197
response = optimize_operation.result()
198198
199199
Args:
200-
request (Union[google.cloud.bigtable.admin_v2.types.RestoreTableRequest, dict]):
200+
request (Union[google.cloud.bigtable_admin_v2.types.RestoreTableRequest, dict]):
201201
The request object. The request for
202202
[RestoreTable][google.bigtable.admin.v2.BigtableTableAdmin.RestoreTable].
203203
retry (google.api_core.retry.Retry): Designation of what errors, if any,
@@ -209,10 +209,10 @@ def sample_restore_table():
209209
be of type `bytes`.
210210
211211
Returns:
212-
google.cloud.bigtable.admin_v2.overlay.types.restore_table.RestoreTableOperation:
212+
google.cloud.bigtable_admin_v2.overlay.types.restore_table.RestoreTableOperation:
213213
An object representing a long-running operation.
214214
215-
The result type for the operation will be :class:`google.cloud.bigtable.admin_v2.types.Table` A collection of user data indexed by row, column, and timestamp.
215+
The result type for the operation will be :class:`google.cloud.bigtable_admin_v2.types.Table` A collection of user data indexed by row, column, and timestamp.
216216
Each table is served using the resources of its
217217
parent cluster.
218218
"""
@@ -273,7 +273,7 @@ def sample_wait_for_consistency():
273273
print(response)
274274
275275
Args:
276-
request (Union[google.cloud.bigtable.admin_v2.overlay.types.WaitForConsistencyRequest, dict]):
276+
request (Union[google.cloud.bigtable_admin_v2.overlay.types.WaitForConsistencyRequest, dict]):
277277
The request object.
278278
name (str):
279279
Required. The unique name of the Table for which to

google/cloud/bigtable_admin_v2/overlay/types/async_consistency.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,24 +34,24 @@ class _AsyncCheckConsistencyPollingFuture(async_future.AsyncFuture):
3434
3535
**This class should not be instantiated by users** and should only be instantiated by the admin
3636
client's
37-
:meth:`google.cloud.bigtable.admin_v2.overlay.services.bigtable_table_admin.AsyncBigtableTableAdminClient.wait_for_consistency`
37+
:meth:`google.cloud.bigtable_admin_v2.overlay.services.bigtable_table_admin.AsyncBigtableTableAdminClient.wait_for_consistency`
3838
or
39-
:meth:`google.cloud.bigtable.admin_v2.overlay.services.bigtable_table_admin.AsyncBigtableTableAdminClient.wait_for_replication`
39+
:meth:`google.cloud.bigtable_admin_v2.overlay.services.bigtable_table_admin.AsyncBigtableTableAdminClient.wait_for_replication`
4040
methods.
4141
4242
Args:
4343
check_consistency_call(Callable[
4444
[Optional[google.api_core.retry.Retry],
45-
google.cloud.bigtable.admin_v2.types.CheckConsistencyResponse]):
45+
google.cloud.bigtable_admin_v2.types.CheckConsistencyResponse]):
4646
A :meth:`check_consistency
47-
<google.cloud.bigtable.admin_v2.overlay.services.bigtable_table_admin.AsyncBigtableTableAdminClient.check_consistency>`
47+
<google.cloud.bigtable_admin_v2.overlay.services.bigtable_table_admin.AsyncBigtableTableAdminClient.check_consistency>`
4848
call from the admin client. The call should fix every user parameter except for retry,
4949
which will be done via :meth:`functools.partial`.
5050
default_retry(Optional[google.api_core.retry.Retry]): The `retry` parameter passed in to either
5151
:meth:`wait_for_consistency
52-
<google.cloud.bigtable.admin_v2.overlay.services.bigtable_table_admin.BigtableTableAdminClient.wait_for_consistency>`
52+
<google.cloud.bigtable_admin_v2.overlay.services.bigtable_table_admin.BigtableTableAdminClient.wait_for_consistency>`
5353
or :meth:`wait_for_replication
54-
<google.cloud.bigtable.admin_v2.overlay.services.bigtable_table_admin.BigtableTableAdminClient.wait_for_replication>`
54+
<google.cloud.bigtable_admin_v2.overlay.services.bigtable_table_admin.BigtableTableAdminClient.wait_for_replication>`
5555
retry (google.api_core.retry.AsyncRetry): The retry configuration used
5656
when polling. This can be used to control how often :meth:`done`
5757
is polled. Regardless of the retry's ``deadline``, it will be

google/cloud/bigtable_admin_v2/overlay/types/async_restore_table.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ class AsyncRestoreTableOperation(operation_async.AsyncOperation):
3030
3131
**This class should not be instantiated by users** and should only be instantiated by the admin
3232
client's :meth:`restore_table
33-
<google.cloud.bigtable.admin_v2.overlay.services.bigtable_table_admin.BigtableTableAdminAsyncClient.restore_table>`
33+
<google.cloud.bigtable_admin_v2.overlay.services.bigtable_table_admin.BigtableTableAdminAsyncClient.restore_table>`
3434
method.
3535
3636
Args:

google/cloud/bigtable_admin_v2/overlay/types/consistency.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,17 +34,17 @@ class _CheckConsistencyPollingFuture(polling.PollingFuture):
3434
3535
**This class should not be instantiated by users** and should only be instantiated by the admin
3636
client's
37-
:meth:`google.cloud.bigtable.admin_v2.overlay.services.bigtable_table_admin.BigtableTableAdminClient.wait_for_consistency`
37+
:meth:`google.cloud.bigtable_admin_v2.overlay.services.bigtable_table_admin.BigtableTableAdminClient.wait_for_consistency`
3838
or
39-
:meth:`google.cloud.bigtable.admin_v2.overlay.services.bigtable_table_admin.BigtableTableAdminClient.wait_for_replication`
39+
:meth:`google.cloud.bigtable_admin_v2.overlay.services.bigtable_table_admin.BigtableTableAdminClient.wait_for_replication`
4040
methods.
4141
4242
Args:
4343
check_consistency_call(Callable[
4444
[Optional[google.api_core.retry.Retry],
45-
google.cloud.bigtable.admin_v2.types.CheckConsistencyResponse]):
45+
google.cloud.bigtable_admin_v2.types.CheckConsistencyResponse]):
4646
A :meth:`check_consistency
47-
<google.cloud.bigtable.admin_v2.overlay.services.bigtable_table_admin.BigtableTableAdminClient.check_consistency>`
47+
<google.cloud.bigtable_admin_v2.overlay.services.bigtable_table_admin.BigtableTableAdminClient.check_consistency>`
4848
call from the admin client. The call should fix every user parameter,
4949
which will be done via :meth:`functools.partial`.
5050
polling (google.api_core.retry.Retry): The configuration used for polling.

google/cloud/bigtable_admin_v2/overlay/types/restore_table.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ class RestoreTableOperation(operation.Operation):
3030
3131
**This class should not be instantiated by users** and should only be instantiated by the admin
3232
client's :meth:`restore_table
33-
<google.cloud.bigtable.admin_v2.overlay.services.bigtable_table_admin.BigtableTableAdminClient.restore_table>`
33+
<google.cloud.bigtable_admin_v2.overlay.services.bigtable_table_admin.BigtableTableAdminClient.restore_table>`
3434
method.
3535
3636
Args:
@@ -62,7 +62,7 @@ def optimize_restored_table_operation(self) -> Optional[operation.Operation]:
6262
The follow-up operation has
6363
:attr:`metadata <google.api_core.operation.Operation.metadata>` type
6464
:class:`OptimizeRestoredTableMetadata
65-
<google.cloud.bigtable.admin_v2.types.bigtable_table_admin.OptimizeRestoredTableMetadata>`
65+
<google.cloud.bigtable_admin_v2.types.bigtable_table_admin.OptimizeRestoredTableMetadata>`
6666
and no return value, but can be waited for with `result`.
6767
6868
The current operation might not trigger a follow-up OptimizeRestoredTable operation, in which case, this

google/cloud/bigtable_admin_v2/overlay/types/wait_for_consistency_request.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@
3434
# for an autogenerated call.
3535
class WaitForConsistencyRequest(proto.Message):
3636
"""Wrapper class for encapsulating parameters for the `wait_for_consistency` method in both
37-
:class:`google.cloud.bigtable.admin_v2.overlay.services.bigtable_table_admin.client.BigtableTableAdminClient`
38-
and :class:`google.cloud.bigtable.admin_v2.overlay.services.bigtable_table_admin.async_client.BigtableTableAdmiAsyncClient`.
37+
:class:`google.cloud.bigtable_admin_v2.overlay.services.bigtable_table_admin.client.BigtableTableAdminClient`
38+
and :class:`google.cloud.bigtable_admin_v2.overlay.services.bigtable_table_admin.async_client.BigtableTableAdmiAsyncClient`.
3939
4040
4141
This message has `oneof`_ fields (mutually exclusive fields).
@@ -50,14 +50,14 @@ class WaitForConsistencyRequest(proto.Message):
5050
Required. The unique name of the Table for which to check
5151
replication consistency. Values are of the form
5252
``projects/{project}/instances/{instance}/tables/{table}``.
53-
standard_read_remote_writes (google.cloud.bigtable.admin_v2.types.StandardReadRemoteWrites):
53+
standard_read_remote_writes (google.cloud.bigtable_admin_v2.types.StandardReadRemoteWrites):
5454
Checks that reads using an app profile with
5555
``StandardIsolation`` can see all writes committed before
5656
the token was created, even if the read and write target
5757
different clusters.
5858
5959
This field is a member of `oneof`_ ``mode``.
60-
data_boost_read_local_writes (google.cloud.bigtable.admin_v2.types.DataBoostReadLocalWrites):
60+
data_boost_read_local_writes (google.cloud.bigtable_admin_v2.types.DataBoostReadLocalWrites):
6161
Checks that reads using an app profile with
6262
``DataBoostIsolationReadOnly`` can see all writes committed
6363
before the token was created, but only if the read and write

tests/system/admin_overlay/test_system_async.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
from google.cloud import bigtable_admin_v2 as admin_v2
1818
from google.cloud.bigtable.data._cross_sync import CrossSync
1919
from google.cloud.bigtable.data import mutations, read_rows_query
20+
from google.cloud.environment_vars import BIGTABLE_EMULATOR
2021

2122
from .conftest import (
2223
INSTANCE_PREFIX,
@@ -37,6 +38,7 @@
3738
from datetime import datetime, timedelta
3839

3940
import pytest
41+
import os
4042

4143

4244
if CrossSync.is_async:
@@ -47,6 +49,12 @@
4749

4850
__CROSS_SYNC_OUTPUT__ = "tests.system.admin_overlay.test_system_autogen"
4951

52+
if os.getenv(BIGTABLE_EMULATOR):
53+
pytest.skip(
54+
allow_module_level=True,
55+
reason="Emulator support for admin client tests unsupported.",
56+
)
57+
5058

5159
@CrossSync.convert
5260
@CrossSync.pytest_fixture(scope="session")

tests/system/admin_overlay/test_system_autogen.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
from google.cloud import bigtable_admin_v2 as admin_v2
2020
from google.cloud.bigtable.data._cross_sync import CrossSync
2121
from google.cloud.bigtable.data import mutations, read_rows_query
22+
from google.cloud.environment_vars import BIGTABLE_EMULATOR
2223
from .conftest import (
2324
INSTANCE_PREFIX,
2425
BACKUP_PREFIX,
@@ -36,8 +37,15 @@
3637
)
3738
from datetime import datetime, timedelta
3839
import pytest
40+
import os
3941
from google.api_core import operation as api_core_operation
4042

43+
if os.getenv(BIGTABLE_EMULATOR):
44+
pytest.skip(
45+
allow_module_level=True,
46+
reason="Emulator support for admin client tests unsupported.",
47+
)
48+
4149

4250
@pytest.fixture(scope="session")
4351
def data_client(admin_overlay_project_id):

0 commit comments

Comments
 (0)