diff --git a/google/cloud/datastore_admin_v1/services/datastore_admin/async_client.py b/google/cloud/datastore_admin_v1/services/datastore_admin/async_client.py index d940a0b0..818fb6bf 100644 --- a/google/cloud/datastore_admin_v1/services/datastore_admin/async_client.py +++ b/google/cloud/datastore_admin_v1/services/datastore_admin/async_client.py @@ -1272,7 +1272,7 @@ async def cancel_operation( metadata=metadata, ) - async def __aenter__(self): + async def __aenter__(self) -> "DatastoreAdminAsyncClient": return self async def __aexit__(self, exc_type, exc, tb): diff --git a/google/cloud/datastore_v1/services/datastore/async_client.py b/google/cloud/datastore_v1/services/datastore/async_client.py index 84c963d0..4e0bf535 100644 --- a/google/cloud/datastore_v1/services/datastore/async_client.py +++ b/google/cloud/datastore_v1/services/datastore/async_client.py @@ -1363,7 +1363,7 @@ async def cancel_operation( metadata=metadata, ) - async def __aenter__(self): + async def __aenter__(self) -> "DatastoreAsyncClient": return self async def __aexit__(self, exc_type, exc, tb): diff --git a/google/cloud/datastore_v1/types/entity.py b/google/cloud/datastore_v1/types/entity.py index ed66e490..9fd055b7 100644 --- a/google/cloud/datastore_v1/types/entity.py +++ b/google/cloud/datastore_v1/types/entity.py @@ -38,11 +38,11 @@ class PartitionId(proto.Message): r"""A partition ID identifies a grouping of entities. The grouping is - always by project. database. and namespace, however the namespace ID may be - empty. Empty database ID refers to the default database. + always by project and namespace, however the namespace ID may be + empty. - A partition ID contains several dimensions: project ID, database ID, - and namespace ID. + A partition ID contains several dimensions: project ID and namespace + ID. Partition dimensions: @@ -54,7 +54,7 @@ class PartitionId(proto.Message): ID is forbidden in certain documented contexts. Foreign partition IDs (in which the project ID does not match the - context project ID) are discouraged. Reads and writes of foreign + context project ID ) are discouraged. Reads and writes of foreign partition IDs may fail if the project is not in an active state. Attributes: @@ -63,7 +63,7 @@ class PartitionId(proto.Message): belong. database_id (str): If not empty, the ID of the database to which - the entities belong. Empty corresponds to the default database. + the entities belong. namespace_id (str): If not empty, the ID of the namespace to which the entities belong. diff --git a/tests/unit/gapic/datastore_admin_v1/test_datastore_admin.py b/tests/unit/gapic/datastore_admin_v1/test_datastore_admin.py index 8e9b37d0..47d3153e 100644 --- a/tests/unit/gapic/datastore_admin_v1/test_datastore_admin.py +++ b/tests/unit/gapic/datastore_admin_v1/test_datastore_admin.py @@ -2016,9 +2016,11 @@ async def test_list_indexes_async_pages(): RuntimeError, ) pages = [] - async for page_ in ( + # Workaround issue in python 3.9 related to code coverage by adding `# pragma: no branch` + # See https://github.com/googleapis/gapic-generator-python/pull/1174#issuecomment-1025132372 + async for page_ in ( # pragma: no branch await client.list_indexes(request={}) - ).pages: # pragma: no branch + ).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token