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

Commit 7c081a6

Browse files
fix: Add async context manager return types (#539)
* 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 2db15f0 commit 7c081a6

File tree

18 files changed

+45
-79
lines changed

18 files changed

+45
-79
lines changed

google/cloud/dataproc_v1/services/autoscaling_policy_service/async_client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1368,7 +1368,7 @@ async def test_iam_permissions(
13681368
# Done; return the response.
13691369
return response
13701370

1371-
async def __aenter__(self):
1371+
async def __aenter__(self) -> "AutoscalingPolicyServiceAsyncClient":
13721372
return self
13731373

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

google/cloud/dataproc_v1/services/autoscaling_policy_service/transports/rest.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1088,7 +1088,7 @@ def __call__(
10881088
request_kwargs = json_format.MessageToDict(request)
10891089
transcoded_request = path_template.transcode(http_options, **request_kwargs)
10901090

1091-
body = json.loads(json.dumps(transcoded_request["body"]))
1091+
body = json.dumps(transcoded_request["body"])
10921092
uri = transcoded_request["uri"]
10931093
method = transcoded_request["method"]
10941094

@@ -1188,7 +1188,7 @@ def __call__(
11881188
request_kwargs = json_format.MessageToDict(request)
11891189
transcoded_request = path_template.transcode(http_options, **request_kwargs)
11901190

1191-
body = json.loads(json.dumps(transcoded_request["body"]))
1191+
body = json.dumps(transcoded_request["body"])
11921192
uri = transcoded_request["uri"]
11931193
method = transcoded_request["method"]
11941194

@@ -1290,7 +1290,7 @@ def __call__(
12901290
request_kwargs = json_format.MessageToDict(request)
12911291
transcoded_request = path_template.transcode(http_options, **request_kwargs)
12921292

1293-
body = json.loads(json.dumps(transcoded_request["body"]))
1293+
body = json.dumps(transcoded_request["body"])
12941294
uri = transcoded_request["uri"]
12951295
method = transcoded_request["method"]
12961296

google/cloud/dataproc_v1/services/batch_controller/async_client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1193,7 +1193,7 @@ async def test_iam_permissions(
11931193
# Done; return the response.
11941194
return response
11951195

1196-
async def __aenter__(self):
1196+
async def __aenter__(self) -> "BatchControllerAsyncClient":
11971197
return self
11981198

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

google/cloud/dataproc_v1/services/batch_controller/transports/rest.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -945,7 +945,7 @@ def __call__(
945945
request_kwargs = json_format.MessageToDict(request)
946946
transcoded_request = path_template.transcode(http_options, **request_kwargs)
947947

948-
body = json.loads(json.dumps(transcoded_request["body"]))
948+
body = json.dumps(transcoded_request["body"])
949949
uri = transcoded_request["uri"]
950950
method = transcoded_request["method"]
951951

@@ -1045,7 +1045,7 @@ def __call__(
10451045
request_kwargs = json_format.MessageToDict(request)
10461046
transcoded_request = path_template.transcode(http_options, **request_kwargs)
10471047

1048-
body = json.loads(json.dumps(transcoded_request["body"]))
1048+
body = json.dumps(transcoded_request["body"])
10491049
uri = transcoded_request["uri"]
10501050
method = transcoded_request["method"]
10511051

@@ -1147,7 +1147,7 @@ def __call__(
11471147
request_kwargs = json_format.MessageToDict(request)
11481148
transcoded_request = path_template.transcode(http_options, **request_kwargs)
11491149

1150-
body = json.loads(json.dumps(transcoded_request["body"]))
1150+
body = json.dumps(transcoded_request["body"])
11511151
uri = transcoded_request["uri"]
11521152
method = transcoded_request["method"]
11531153

google/cloud/dataproc_v1/services/cluster_controller/async_client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1984,7 +1984,7 @@ async def test_iam_permissions(
19841984
# Done; return the response.
19851985
return response
19861986

1987-
async def __aenter__(self):
1987+
async def __aenter__(self) -> "ClusterControllerAsyncClient":
19881988
return self
19891989

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

google/cloud/dataproc_v1/services/cluster_controller/transports/rest.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1523,7 +1523,7 @@ def __call__(
15231523
request_kwargs = json_format.MessageToDict(request)
15241524
transcoded_request = path_template.transcode(http_options, **request_kwargs)
15251525

1526-
body = json.loads(json.dumps(transcoded_request["body"]))
1526+
body = json.dumps(transcoded_request["body"])
15271527
uri = transcoded_request["uri"]
15281528
method = transcoded_request["method"]
15291529

@@ -1623,7 +1623,7 @@ def __call__(
16231623
request_kwargs = json_format.MessageToDict(request)
16241624
transcoded_request = path_template.transcode(http_options, **request_kwargs)
16251625

1626-
body = json.loads(json.dumps(transcoded_request["body"]))
1626+
body = json.dumps(transcoded_request["body"])
16271627
uri = transcoded_request["uri"]
16281628
method = transcoded_request["method"]
16291629

@@ -1725,7 +1725,7 @@ def __call__(
17251725
request_kwargs = json_format.MessageToDict(request)
17261726
transcoded_request = path_template.transcode(http_options, **request_kwargs)
17271727

1728-
body = json.loads(json.dumps(transcoded_request["body"]))
1728+
body = json.dumps(transcoded_request["body"])
17291729
uri = transcoded_request["uri"]
17301730
method = transcoded_request["method"]
17311731

google/cloud/dataproc_v1/services/job_controller/async_client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1697,7 +1697,7 @@ async def test_iam_permissions(
16971697
# Done; return the response.
16981698
return response
16991699

1700-
async def __aenter__(self):
1700+
async def __aenter__(self) -> "JobControllerAsyncClient":
17011701
return self
17021702

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

google/cloud/dataproc_v1/services/job_controller/transports/rest.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1325,7 +1325,7 @@ def __call__(
13251325
request_kwargs = json_format.MessageToDict(request)
13261326
transcoded_request = path_template.transcode(http_options, **request_kwargs)
13271327

1328-
body = json.loads(json.dumps(transcoded_request["body"]))
1328+
body = json.dumps(transcoded_request["body"])
13291329
uri = transcoded_request["uri"]
13301330
method = transcoded_request["method"]
13311331

@@ -1425,7 +1425,7 @@ def __call__(
14251425
request_kwargs = json_format.MessageToDict(request)
14261426
transcoded_request = path_template.transcode(http_options, **request_kwargs)
14271427

1428-
body = json.loads(json.dumps(transcoded_request["body"]))
1428+
body = json.dumps(transcoded_request["body"])
14291429
uri = transcoded_request["uri"]
14301430
method = transcoded_request["method"]
14311431

@@ -1527,7 +1527,7 @@ def __call__(
15271527
request_kwargs = json_format.MessageToDict(request)
15281528
transcoded_request = path_template.transcode(http_options, **request_kwargs)
15291529

1530-
body = json.loads(json.dumps(transcoded_request["body"]))
1530+
body = json.dumps(transcoded_request["body"])
15311531
uri = transcoded_request["uri"]
15321532
method = transcoded_request["method"]
15331533

google/cloud/dataproc_v1/services/node_group_controller/async_client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1129,7 +1129,7 @@ async def test_iam_permissions(
11291129
# Done; return the response.
11301130
return response
11311131

1132-
async def __aenter__(self):
1132+
async def __aenter__(self) -> "NodeGroupControllerAsyncClient":
11331133
return self
11341134

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

google/cloud/dataproc_v1/services/node_group_controller/transports/rest.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -873,7 +873,7 @@ def __call__(
873873
request_kwargs = json_format.MessageToDict(request)
874874
transcoded_request = path_template.transcode(http_options, **request_kwargs)
875875

876-
body = json.loads(json.dumps(transcoded_request["body"]))
876+
body = json.dumps(transcoded_request["body"])
877877
uri = transcoded_request["uri"]
878878
method = transcoded_request["method"]
879879

@@ -973,7 +973,7 @@ def __call__(
973973
request_kwargs = json_format.MessageToDict(request)
974974
transcoded_request = path_template.transcode(http_options, **request_kwargs)
975975

976-
body = json.loads(json.dumps(transcoded_request["body"]))
976+
body = json.dumps(transcoded_request["body"])
977977
uri = transcoded_request["uri"]
978978
method = transcoded_request["method"]
979979

@@ -1075,7 +1075,7 @@ def __call__(
10751075
request_kwargs = json_format.MessageToDict(request)
10761076
transcoded_request = path_template.transcode(http_options, **request_kwargs)
10771077

1078-
body = json.loads(json.dumps(transcoded_request["body"]))
1078+
body = json.dumps(transcoded_request["body"])
10791079
uri = transcoded_request["uri"]
10801080
method = transcoded_request["method"]
10811081

0 commit comments

Comments
 (0)