Skip to content

Commit

Permalink
fix: Add async context manager return types (#255)
Browse files Browse the repository at this point in the history
* 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

* revert

* 🦉 Updates from OwlBot post-processor

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

* revert

---------

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
Co-authored-by: Anthonios Partheniou <[email protected]>
  • Loading branch information
3 people authored Jul 4, 2023
1 parent 20a6f2c commit 35a0ecf
Show file tree
Hide file tree
Showing 8 changed files with 20 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -659,7 +659,7 @@ async def sample_cancel_execution():
# Done; return the response.
return response

async def __aenter__(self):
async def __aenter__(self) -> "ExecutionsAsyncClient":
return self

async def __aexit__(self, exc_type, exc, tb):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -662,7 +662,7 @@ async def sample_cancel_execution():
# Done; return the response.
return response

async def __aenter__(self):
async def __aenter__(self) -> "ExecutionsAsyncClient":
return self

async def __aexit__(self, exc_type, exc, tb):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -860,7 +860,7 @@ async def sample_update_workflow():
# Done; return the response.
return response

async def __aenter__(self):
async def __aenter__(self) -> "WorkflowsAsyncClient":
return self

async def __aexit__(self, exc_type, exc, tb):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -860,7 +860,7 @@ async def sample_update_workflow():
# Done; return the response.
return response

async def __aenter__(self):
async def __aenter__(self) -> "WorkflowsAsyncClient":
return self

async def __aexit__(self, exc_type, exc, tb):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1070,9 +1070,11 @@ async def test_list_executions_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_executions(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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1070,9 +1070,11 @@ async def test_list_executions_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_executions(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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1104,9 +1104,11 @@ async def test_list_workflows_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_workflows(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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1104,9 +1104,11 @@ async def test_list_workflows_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_workflows(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
Expand Down

0 comments on commit 35a0ecf

Please sign in to comment.