Skip to content

Commit 2a5a636

Browse files
feat: Adding new fields for Serverless analytics (#906)
* feat: Adding new fields for Serverless analytics PiperOrigin-RevId: 513499163 Source-Link: googleapis/googleapis@c3ffffa Source-Link: googleapis/googleapis-gen@3e262dc Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiM2UyNjJkYzg2YTllNzNlYTBiNmNmZDdkMTlhYzc2ODVhYzM0YTBlNSJ9 * 🦉 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 777229d commit 2a5a636

File tree

5 files changed

+31
-7
lines changed

5 files changed

+31
-7
lines changed

google/cloud/spanner_v1/types/spanner.py

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -476,6 +476,14 @@ class ExecuteSqlRequest(proto.Message):
476476
given query.
477477
request_options (google.cloud.spanner_v1.types.RequestOptions):
478478
Common options for this request.
479+
data_boost_enabled (bool):
480+
If this is for a partitioned read and this field is set to
481+
``true``, the request will be executed via Spanner
482+
independent compute resources.
483+
484+
If the field is set to ``true`` but the request does not set
485+
``partition_token``, the API will return an
486+
``INVALID_ARGUMENT`` error.
479487
"""
480488

481489
class QueryMode(proto.Enum):
@@ -615,6 +623,10 @@ class QueryOptions(proto.Message):
615623
number=11,
616624
message="RequestOptions",
617625
)
626+
data_boost_enabled: bool = proto.Field(
627+
proto.BOOL,
628+
number=15,
629+
)
618630

619631

620632
class ExecuteBatchDmlRequest(proto.Message):
@@ -1125,6 +1137,14 @@ class ReadRequest(proto.Message):
11251137
create this partition_token.
11261138
request_options (google.cloud.spanner_v1.types.RequestOptions):
11271139
Common options for this request.
1140+
data_boost_enabled (bool):
1141+
If this is for a partitioned query and this field is set to
1142+
``true``, the request will be executed via Spanner
1143+
independent compute resources.
1144+
1145+
If the field is set to ``true`` but the request does not set
1146+
``partition_token``, the API will return an
1147+
``INVALID_ARGUMENT`` error.
11281148
"""
11291149

11301150
session: str = proto.Field(
@@ -1170,6 +1190,10 @@ class ReadRequest(proto.Message):
11701190
number=11,
11711191
message="RequestOptions",
11721192
)
1193+
data_boost_enabled: bool = proto.Field(
1194+
proto.BOOL,
1195+
number=16,
1196+
)
11731197

11741198

11751199
class BeginTransactionRequest(proto.Message):

samples/generated_samples/snippet_metadata_google.spanner.admin.database.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-spanner-admin-database",
11-
"version": "3.28.0"
11+
"version": "0.1.0"
1212
},
1313
"snippets": [
1414
{

samples/generated_samples/snippet_metadata_google.spanner.admin.instance.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-spanner-admin-instance",
11-
"version": "3.28.0"
11+
"version": "0.1.0"
1212
},
1313
"snippets": [
1414
{

samples/generated_samples/snippet_metadata_google.spanner.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-spanner",
11-
"version": "3.28.0"
11+
"version": "0.1.0"
1212
},
1313
"snippets": [
1414
{

scripts/fixup_spanner_v1_keywords.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,15 +45,15 @@ class spannerCallTransformer(cst.CSTTransformer):
4545
'create_session': ('database', 'session', ),
4646
'delete_session': ('name', ),
4747
'execute_batch_dml': ('session', 'transaction', 'statements', 'seqno', 'request_options', ),
48-
'execute_sql': ('session', 'sql', 'transaction', 'params', 'param_types', 'resume_token', 'query_mode', 'partition_token', 'seqno', 'query_options', 'request_options', ),
49-
'execute_streaming_sql': ('session', 'sql', 'transaction', 'params', 'param_types', 'resume_token', 'query_mode', 'partition_token', 'seqno', 'query_options', 'request_options', ),
48+
'execute_sql': ('session', 'sql', 'transaction', 'params', 'param_types', 'resume_token', 'query_mode', 'partition_token', 'seqno', 'query_options', 'request_options', 'data_boost_enabled', ),
49+
'execute_streaming_sql': ('session', 'sql', 'transaction', 'params', 'param_types', 'resume_token', 'query_mode', 'partition_token', 'seqno', 'query_options', 'request_options', 'data_boost_enabled', ),
5050
'get_session': ('name', ),
5151
'list_sessions': ('database', 'page_size', 'page_token', 'filter', ),
5252
'partition_query': ('session', 'sql', 'transaction', 'params', 'param_types', 'partition_options', ),
5353
'partition_read': ('session', 'table', 'key_set', 'transaction', 'index', 'columns', 'partition_options', ),
54-
'read': ('session', 'table', 'columns', 'key_set', 'transaction', 'index', 'limit', 'resume_token', 'partition_token', 'request_options', ),
54+
'read': ('session', 'table', 'columns', 'key_set', 'transaction', 'index', 'limit', 'resume_token', 'partition_token', 'request_options', 'data_boost_enabled', ),
5555
'rollback': ('session', 'transaction_id', ),
56-
'streaming_read': ('session', 'table', 'columns', 'key_set', 'transaction', 'index', 'limit', 'resume_token', 'partition_token', 'request_options', ),
56+
'streaming_read': ('session', 'table', 'columns', 'key_set', 'transaction', 'index', 'limit', 'resume_token', 'partition_token', 'request_options', 'data_boost_enabled', ),
5757
}
5858

5959
def leave_Call(self, original: cst.Call, updated: cst.Call) -> cst.CSTNode:

0 commit comments

Comments
 (0)