Skip to content
This repository was archived by the owner on Nov 29, 2023. It is now read-only.

Commit aa9088a

Browse files
fix: Add async context manager return types (#320)
* 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: https://github.com/googleapis/googleapis-gen/commit/b3f18d0f6560a855022fd058865e7620479d7af9 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 98bfb2d commit aa9088a

File tree

3 files changed

+6
-18
lines changed

3 files changed

+6
-18
lines changed

google/cloud/bigquery_connection_v1/services/connection_service/async_client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1267,7 +1267,7 @@ async def sample_test_iam_permissions():
12671267
# Done; return the response.
12681268
return response
12691269

1270-
async def __aenter__(self):
1270+
async def __aenter__(self) -> "ConnectionServiceAsyncClient":
12711271
return self
12721272

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

samples/generated_samples/snippet_metadata_google.cloud.bigquery.connection.v1.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
],
99
"language": "PYTHON",
1010
"name": "google-cloud-bigquery-connection",
11-
"version": "1.12.0"
11+
"version": "0.1.0"
1212
},
1313
"snippets": [
1414
{

tests/unit/gapic/bigquery_connection_v1/test_connection_service.py

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -770,9 +770,6 @@ def test_create_connection(request_type, transport: str = "grpc"):
770770
creation_time=1379,
771771
last_modified_time=1890,
772772
has_credential=True,
773-
cloud_sql=gcbc_connection.CloudSqlProperties(
774-
instance_id="instance_id_value"
775-
),
776773
)
777774
response = client.create_connection(request)
778775

@@ -1058,7 +1055,6 @@ def test_get_connection(request_type, transport: str = "grpc"):
10581055
creation_time=1379,
10591056
last_modified_time=1890,
10601057
has_credential=True,
1061-
cloud_sql=connection.CloudSqlProperties(instance_id="instance_id_value"),
10621058
)
10631059
response = client.get_connection(request)
10641060

@@ -1696,9 +1692,11 @@ async def test_list_connections_async_pages():
16961692
RuntimeError,
16971693
)
16981694
pages = []
1699-
async for page_ in (
1695+
# Workaround issue in python 3.9 related to code coverage by adding `# pragma: no branch`
1696+
# See https://github.com/googleapis/gapic-generator-python/pull/1174#issuecomment-1025132372
1697+
async for page_ in ( # pragma: no branch
17001698
await client.list_connections(request={})
1701-
).pages: # pragma: no branch
1699+
).pages:
17021700
pages.append(page_)
17031701
for page_, token in zip(pages, ["abc", "def", "ghi", ""]):
17041702
assert page_.raw_page.next_page_token == token
@@ -1733,9 +1731,6 @@ def test_update_connection(request_type, transport: str = "grpc"):
17331731
creation_time=1379,
17341732
last_modified_time=1890,
17351733
has_credential=True,
1736-
cloud_sql=gcbc_connection.CloudSqlProperties(
1737-
instance_id="instance_id_value"
1738-
),
17391734
)
17401735
response = client.update_connection(request)
17411736

@@ -3081,9 +3076,6 @@ def test_create_connection_rest(request_type):
30813076
creation_time=1379,
30823077
last_modified_time=1890,
30833078
has_credential=True,
3084-
cloud_sql=gcbc_connection.CloudSqlProperties(
3085-
instance_id="instance_id_value"
3086-
),
30873079
)
30883080

30893081
# Wrap the value into a proper Response obj
@@ -3428,7 +3420,6 @@ def test_get_connection_rest(request_type):
34283420
creation_time=1379,
34293421
last_modified_time=1890,
34303422
has_credential=True,
3431-
cloud_sql=connection.CloudSqlProperties(instance_id="instance_id_value"),
34323423
)
34333424

34343425
# Wrap the value into a proper Response obj
@@ -4118,9 +4109,6 @@ def test_update_connection_rest(request_type):
41184109
creation_time=1379,
41194110
last_modified_time=1890,
41204111
has_credential=True,
4121-
cloud_sql=gcbc_connection.CloudSqlProperties(
4122-
instance_id="instance_id_value"
4123-
),
41244112
)
41254113

41264114
# Wrap the value into a proper Response obj

0 commit comments

Comments
 (0)