Skip to content

Commit 84d662b

Browse files
feat(spanner): add directed_read_option in spanner.proto (#1030)
* feat(spanner): add directed_read_option in spanner.proto docs(spanner): updated comment formatting PiperOrigin-RevId: 578551679 Source-Link: googleapis/googleapis@7c80b96 Source-Link: googleapis/googleapis-gen@7b1172b Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiN2IxMTcyYmE1ZTAyMGVhZWY3ZGU3NTA2MmE1NzZhMTFiOGUxMTdlNCJ9 * 🦉 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 2d59dd0 commit 84d662b

File tree

5 files changed

+227
-60
lines changed

5 files changed

+227
-60
lines changed

google/cloud/spanner_v1/services/spanner/async_client.py

+24-21
Original file line numberDiff line numberDiff line change
@@ -422,7 +422,7 @@ async def sample_batch_create_sessions():
422422
Returns:
423423
google.cloud.spanner_v1.types.BatchCreateSessionsResponse:
424424
The response for
425-
[BatchCreateSessions][google.spanner.v1.Spanner.BatchCreateSessions].
425+
[BatchCreateSessions][google.spanner.v1.Spanner.BatchCreateSessions].
426426
427427
"""
428428
# Create or coerce a protobuf request object.
@@ -1075,8 +1075,10 @@ async def sample_execute_batch_dml():
10751075
10761076
Returns:
10771077
google.cloud.spanner_v1.types.ExecuteBatchDmlResponse:
1078-
The response for [ExecuteBatchDml][google.spanner.v1.Spanner.ExecuteBatchDml]. Contains a list
1079-
of [ResultSet][google.spanner.v1.ResultSet] messages,
1078+
The response for
1079+
[ExecuteBatchDml][google.spanner.v1.Spanner.ExecuteBatchDml].
1080+
Contains a list of
1081+
[ResultSet][google.spanner.v1.ResultSet] messages,
10801082
one for each DML statement that has successfully
10811083
executed, in the same order as the statements in the
10821084
request. If a statement fails, the status in the
@@ -1086,34 +1088,35 @@ async def sample_execute_batch_dml():
10861088
following approach:
10871089
10881090
1. Check the status in the response message. The
1089-
[google.rpc.Code][google.rpc.Code] enum value OK
1090-
indicates that all statements were executed
1091-
successfully.
1092-
2. If the status was not OK, check the number of
1093-
result sets in the response. If the response
1094-
contains N
1095-
[ResultSet][google.spanner.v1.ResultSet] messages,
1096-
then statement N+1 in the request failed.
1091+
[google.rpc.Code][google.rpc.Code] enum value OK
1092+
indicates that all statements were executed
1093+
successfully. 2. If the status was not OK, check the
1094+
number of result sets in the response. If the
1095+
response contains N
1096+
[ResultSet][google.spanner.v1.ResultSet] messages,
1097+
then statement N+1 in the request failed.
10971098
10981099
Example 1:
10991100
11001101
- Request: 5 DML statements, all executed
11011102
successfully.
1102-
- Response: 5
1103-
[ResultSet][google.spanner.v1.ResultSet] messages,
1104-
with the status OK.
1103+
1104+
\* Response: 5
1105+
[ResultSet][google.spanner.v1.ResultSet] messages,
1106+
with the status OK.
11051107
11061108
Example 2:
11071109
11081110
- Request: 5 DML statements. The third statement has
11091111
a syntax error.
1110-
- Response: 2
1111-
[ResultSet][google.spanner.v1.ResultSet] messages,
1112-
and a syntax error (INVALID_ARGUMENT) status. The
1113-
number of [ResultSet][google.spanner.v1.ResultSet]
1114-
messages indicates that the third statement
1115-
failed, and the fourth and fifth statements were
1116-
not executed.
1112+
1113+
\* Response: 2
1114+
[ResultSet][google.spanner.v1.ResultSet] messages,
1115+
and a syntax error (INVALID_ARGUMENT) status. The
1116+
number of [ResultSet][google.spanner.v1.ResultSet]
1117+
messages indicates that the third statement failed,
1118+
and the fourth and fifth statements were not
1119+
executed.
11171120
11181121
"""
11191122
# Create or coerce a protobuf request object.

google/cloud/spanner_v1/services/spanner/client.py

+24-21
Original file line numberDiff line numberDiff line change
@@ -669,7 +669,7 @@ def sample_batch_create_sessions():
669669
Returns:
670670
google.cloud.spanner_v1.types.BatchCreateSessionsResponse:
671671
The response for
672-
[BatchCreateSessions][google.spanner.v1.Spanner.BatchCreateSessions].
672+
[BatchCreateSessions][google.spanner.v1.Spanner.BatchCreateSessions].
673673
674674
"""
675675
# Create or coerce a protobuf request object.
@@ -1279,8 +1279,10 @@ def sample_execute_batch_dml():
12791279
12801280
Returns:
12811281
google.cloud.spanner_v1.types.ExecuteBatchDmlResponse:
1282-
The response for [ExecuteBatchDml][google.spanner.v1.Spanner.ExecuteBatchDml]. Contains a list
1283-
of [ResultSet][google.spanner.v1.ResultSet] messages,
1282+
The response for
1283+
[ExecuteBatchDml][google.spanner.v1.Spanner.ExecuteBatchDml].
1284+
Contains a list of
1285+
[ResultSet][google.spanner.v1.ResultSet] messages,
12841286
one for each DML statement that has successfully
12851287
executed, in the same order as the statements in the
12861288
request. If a statement fails, the status in the
@@ -1290,34 +1292,35 @@ def sample_execute_batch_dml():
12901292
following approach:
12911293
12921294
1. Check the status in the response message. The
1293-
[google.rpc.Code][google.rpc.Code] enum value OK
1294-
indicates that all statements were executed
1295-
successfully.
1296-
2. If the status was not OK, check the number of
1297-
result sets in the response. If the response
1298-
contains N
1299-
[ResultSet][google.spanner.v1.ResultSet] messages,
1300-
then statement N+1 in the request failed.
1295+
[google.rpc.Code][google.rpc.Code] enum value OK
1296+
indicates that all statements were executed
1297+
successfully. 2. If the status was not OK, check the
1298+
number of result sets in the response. If the
1299+
response contains N
1300+
[ResultSet][google.spanner.v1.ResultSet] messages,
1301+
then statement N+1 in the request failed.
13011302
13021303
Example 1:
13031304
13041305
- Request: 5 DML statements, all executed
13051306
successfully.
1306-
- Response: 5
1307-
[ResultSet][google.spanner.v1.ResultSet] messages,
1308-
with the status OK.
1307+
1308+
\* Response: 5
1309+
[ResultSet][google.spanner.v1.ResultSet] messages,
1310+
with the status OK.
13091311
13101312
Example 2:
13111313
13121314
- Request: 5 DML statements. The third statement has
13131315
a syntax error.
1314-
- Response: 2
1315-
[ResultSet][google.spanner.v1.ResultSet] messages,
1316-
and a syntax error (INVALID_ARGUMENT) status. The
1317-
number of [ResultSet][google.spanner.v1.ResultSet]
1318-
messages indicates that the third statement
1319-
failed, and the fourth and fifth statements were
1320-
not executed.
1316+
1317+
\* Response: 2
1318+
[ResultSet][google.spanner.v1.ResultSet] messages,
1319+
and a syntax error (INVALID_ARGUMENT) status. The
1320+
number of [ResultSet][google.spanner.v1.ResultSet]
1321+
messages indicates that the third statement failed,
1322+
and the fourth and fifth statements were not
1323+
executed.
13211324
13221325
"""
13231326
# Create or coerce a protobuf request object.

google/cloud/spanner_v1/types/__init__.py

+2
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@
4242
CommitRequest,
4343
CreateSessionRequest,
4444
DeleteSessionRequest,
45+
DirectedReadOptions,
4546
ExecuteBatchDmlRequest,
4647
ExecuteBatchDmlResponse,
4748
ExecuteSqlRequest,
@@ -89,6 +90,7 @@
8990
"CommitRequest",
9091
"CreateSessionRequest",
9192
"DeleteSessionRequest",
93+
"DirectedReadOptions",
9294
"ExecuteBatchDmlRequest",
9395
"ExecuteBatchDmlResponse",
9496
"ExecuteSqlRequest",

0 commit comments

Comments
 (0)