8000 fix: Add async context manager return types (#452) · googleapis/python-datastore@05f20dc · GitHub
[go: up one dir, main page]

Skip to content

Commit 05f20dc

Browse files
fix: Add async context manager return types (#452)
* fix: Add async context manager return types chore: Mock return_value should not populate oneof message fields chore: Support snippet generation for services that only support REST transport chore: Update gapic-generator-python to v1.11.0 PiperOrigin-RevId: 545430278 Source-Link: googleapis/googleapis@601b532 Source-Link: googleapis/googleapis-gen@b3f18d0 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiYjNmMThkMGY2NTYwYTg1NTAyMmZkMDU4ODY1ZTc2MjA0NzlkN2FmOSJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --------- Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
1 parent 3337966 commit 05f20dc

File tree

4 files changed

+12
-10
lines changed

4 files changed

+12
-10
lines changed

google/cloud/datastore_admin_v1/services/datastore_admin/async_client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1272,7 +1272,7 @@ async def cancel_operation(
12721272
metadata=metadata,
12731273
)
12741274

1275-
async def __aenter__(self):
1275+
async def __aenter__(self) -> "DatastoreAdminAsyncClient":
12761276
return self
12771277

12781278
async def __aexit__(self, exc_type, exc, tb):

google/cloud/datastore_v1/services/datastore/async_client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1363,7 +1363,7 @@ async def cancel_operation(
13631363
metadata=metadata,
13641364
)
13651365

1366-
async def __aenter__(self):
1366+
async def __aenter__(self) -> "DatastoreAsyncClient":
13671367
return self
13681368

13691369
async def __aexit__(self, exc_type, exc, tb):

google/cloud/datastore_v1/types/entity.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,11 @@
3838

3939
class PartitionId(proto.Message):
4040
r"""A partition ID identifies a grouping of entities. The grouping is
41-
always by project. database. and namespace, however the namespace ID may be
42-
empty. Empty database ID refers to the default database.
41+
always by project and namespace, however the namespace ID may be
42+
empty.
4343
44-
A partition ID contains several dimensions: project ID, database ID,
45-
and namespace ID.
44+
A partition ID contains several dimensions: project ID and namespace
45+
ID.
4646
4747
Partition dimensions:
4848
@@ -54,7 +54,7 @@ class PartitionId(proto.Message):
5454
ID is forbidden in certain documented contexts.
5555
5656
Foreign partition IDs (in which the project ID does not match the
57-
context project ID) are discouraged. Reads and writes of foreign
57+
context project ID ) are discouraged. Reads and writes of foreign
5858
partition IDs may fail if the project is not in an active state.
5959
6060
Attributes:
@@ -63,7 +63,7 @@ class PartitionId(proto.Message):
6363
belong.
6464
database_id (str):
6565
If not empty, the ID of the database to which
66-
the entities belong. Empty corresponds to the default database.
66+
the entities belong.
6767
namespace_id (str):
6868
If not empty, the ID of the namespace to
6969
which the entities belong.

tests/unit/gapic/datastore_admin_v1/test_datastore_admin.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2016,9 +2016,11 @@ async def test_list_indexes_async_pages():
20162016
RuntimeError,
20172017
)
20182018
pages = []
2019-
async for page_ in (
2019+
# Workaround issue in python 3.9 related to code coverage by adding `# pragma: no branch`
2020+
# See https://github.com/googleapis/gapic-generator-python/pull/1174#issuecomment-1025132372
2021+
async for page_ in ( # pragma: no branch
20202022
await client.list_indexes(request={})
2021-
).pages: # pragma: no branch
2023+
).pages:
20222024
pages.append(page_)
20232025
for page_, token in zip(pages, ["abc", "def", "ghi", ""]):
20242026
assert page_.raw_page.next_page_token == token

0 commit comments

Comments
 (0)
0