Skip to content

Commit 1045ce6

Browse files
1 parent ea361f2 commit 1045ce6

File tree

305 files changed

+195
-134982
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

305 files changed

+195
-134982
lines changed

‎docs/_templates/layout.html‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@
2020
{% endblock %}
2121

2222
<div class="body" role="main">
23-
<div class="admonition" id="python2-eol">
24-
As of January 1, 2020 this library no longer supports Python 2 on the latest released version.
23+
<div class="admonition" id="python2-eol">
24+
As of January 1, 2020 this library no longer supports Python 2 on the latest released version.
2525
Library versions released prior to that date will continue to be available. For more information please
2626
visit <a href="https://cloud.google.com/python/docs/python2-sunset/">Python 2 support on Google Cloud</a>.
2727
</div>

‎docs/conf.py‎

Lines changed: 22 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,20 @@
11
# -*- coding: utf-8 -*-
2-
# Copyright 2024 Google LLC
2+
# Copyright 2025 Google LLC
33
#
44
# Licensed under the Apache License, Version 2.0 (the "License");
55
# you may not use this file except in compliance with the License.
66
# You may obtain a copy of the License at
77
#
8-
# http://www.apache.org/licenses/LICENSE-2.0
8+
# http://www.apache.org/licenses/LICENSE-2.0
99
#
1010
# Unless required by applicable law or agreed to in writing, software
1111
# distributed under the License is distributed on an "AS IS" BASIS,
1212
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1313
# See the License for the specific language governing permissions and
1414
# limitations under the License.
1515
#
16-
# google-cloud-spanner documentation build configuration file
16+
#
17+
# google-cloud-spanner-admin-database documentation build configuration file
1718
#
1819
# This file is execfile()d with the current directory set to its
1920
# containing dir.
@@ -42,7 +43,7 @@
4243
# -- General configuration ------------------------------------------------
4344

4445
# If your documentation needs a minimal Sphinx version, state it here.
45-
needs_sphinx = "1.5.5"
46+
needs_sphinx = "4.5.0"
4647

4748
# Add any Sphinx extension module names here, as strings. They can be
4849
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
@@ -80,8 +81,8 @@
8081
root_doc = "index"
8182

8283
# General information about the project.
83-
project = "google-cloud-spanner"
84-
copyright = "2019, Google"
84+
project = "google-cloud-spanner-admin-database"
85+
copyright = "2025, Google, LLC"
8586
author = "Google APIs"
8687

8788
# The version info for the project you're documenting, acts as replacement for
@@ -154,9 +155,9 @@
154155
# further. For a list of options available for each theme, see the
155156
# documentation.
156157
html_theme_options = {
157-
"description": "Google Cloud Client Libraries for google-cloud-spanner",
158+
"description": "Google Cloud Client Libraries for google-cloud-spanner-admin-database",
158159
"github_user": "googleapis",
159-
"github_repo": "python-spanner",
160+
"github_repo": "google-cloud-python",
160161
"github_banner": True,
161162
"font_family": "'Roboto', Georgia, sans",
162163
"head_font_family": "'Roboto', Georgia, serif",
@@ -248,7 +249,7 @@
248249
# html_search_scorer = 'scorer.js'
249250

250251
# Output file base name for HTML help builder.
251-
htmlhelp_basename = "google-cloud-spanner-doc"
252+
htmlhelp_basename = "google-cloud-spanner-admin-database-doc"
252253

253254
# -- Options for warnings ------------------------------------------------------
254255

@@ -266,13 +267,13 @@
266267

267268
latex_elements = {
268269
# The paper size ('letterpaper' or 'a4paper').
269-
#'papersize': 'letterpaper',
270+
# 'papersize': 'letterpaper',
270271
# The font size ('10pt', '11pt' or '12pt').
271-
#'pointsize': '10pt',
272+
# 'pointsize': '10pt',
272273
# Additional stuff for the LaTeX preamble.
273-
#'preamble': '',
274+
# 'preamble': '',
274275
# Latex figure (float) alignment
275-
#'figure_align': 'htbp',
276+
# 'figure_align': 'htbp',
276277
}
277278

278279
# Grouping the document tree into LaTeX files. List of tuples
@@ -281,8 +282,8 @@
281282
latex_documents = [
282283
(
283284
root_doc,
284-
"google-cloud-spanner.tex",
285-
"google-cloud-spanner Documentation",
285+
"google-cloud-spanner-admin-database.tex",
286+
"google-cloud-spanner-admin-database Documentation",
286287
author,
287288
"manual",
288289
)
@@ -316,8 +317,8 @@
316317
man_pages = [
317318
(
318319
root_doc,
319-
"google-cloud-spanner",
320-
"google-cloud-spanner Documentation",
320+
"google-cloud-spanner-admin-database",
321+
"google-cloud-spanner-admin-database Documentation",
321322
[author],
322323
1,
323324
)
@@ -335,11 +336,11 @@
335336
texinfo_documents = [
336337
(
337338
root_doc,
338-
"google-cloud-spanner",
339-
"google-cloud-spanner Documentation",
339+
"google-cloud-spanner-admin-database",
340+
"google-cloud-spanner-admin-database Documentation",
340341
author,
341-
"google-cloud-spanner",
342-
"google-cloud-spanner Library",
342+
"google-cloud-spanner-admin-database",
343+
"google-cloud-spanner-admin-database Library",
343344
"APIs",
344345
)
345346
]

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

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -477,10 +477,11 @@ async def sample_batch_create_sessions():
477477
should not be set.
478478
session_count (:class:`int`):
479479
Required. The number of sessions to be created in this
480-
batch call. The API can return fewer than the requested
481-
number of sessions. If a specific number of sessions are
482-
desired, the client can make additional calls to
483-
``BatchCreateSessions`` (adjusting
480+
batch call. At least one session is created. The API can
481+
return fewer than the requested number of sessions. If a
482+
specific number of sessions are desired, the client can
483+
make additional calls to ``BatchCreateSessions``
484+
(adjusting
484485
[session_count][google.spanner.v1.BatchCreateSessionsRequest.session_count]
485486
as necessary).
486487

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

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -922,10 +922,11 @@ def sample_batch_create_sessions():
922922
should not be set.
923923
session_count (int):
924924
Required. The number of sessions to be created in this
925-
batch call. The API can return fewer than the requested
926-
number of sessions. If a specific number of sessions are
927-
desired, the client can make additional calls to
928-
``BatchCreateSessions`` (adjusting
925+
batch call. At least one session is created. The API can
926+
return fewer than the requested number of sessions. If a
927+
specific number of sessions are desired, the client can
928+
make additional calls to ``BatchCreateSessions``
929+
(adjusting
929930
[session_count][google.spanner.v1.BatchCreateSessionsRequest.session_count]
930931
as necessary).
931932

‎google/cloud/spanner_v1/types/__init__.py‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
)
2929
from .query_plan import (
3030
PlanNode,
31+
QueryAdvisorResult,
3132
QueryPlan,
3233
)
3334
from .result_set import (
@@ -82,6 +83,7 @@
8283
"KeySet",
8384
"Mutation",
8485
"PlanNode",
86+
"QueryAdvisorResult",
8587
"QueryPlan",
8688
"PartialResultSet",
8789
"ResultSet",

‎google/cloud/spanner_v1/types/mutation.py‎

Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121

2222
from google.cloud.spanner_v1.types import keys
2323
from google.protobuf import struct_pb2 # type: ignore
24+
from google.protobuf import timestamp_pb2 # type: ignore
2425

2526

2627
__protobuf__ = proto.module(
@@ -89,6 +90,14 @@ class Mutation(proto.Message):
8990
Delete rows from a table. Succeeds whether or
9091
not the named rows were present.
9192
93+
This field is a member of `oneof`_ ``operation``.
94+
send (google.cloud.spanner_v1.types.Mutation.Send):
95+
Send a message to a queue.
96+
97+
This field is a member of `oneof`_ ``operation``.
98+
ack (google.cloud.spanner_v1.types.Mutation.Ack):
99+
Ack a message from a queue.
100+
92101
This field is a member of `oneof`_ ``operation``.
93102
"""
94103

@@ -166,6 +175,79 @@ class Delete(proto.Message):
166175
message=keys.KeySet,
167176
)
168177

178+
class Send(proto.Message):
179+
r"""Arguments to [send][google.spanner.v1.Mutation.send] operations.
180+
181+
Attributes:
182+
queue (str):
183+
Required. The queue to which the message will
184+
be sent.
185+
key (google.protobuf.struct_pb2.ListValue):
186+
Required. The primary key of the message to
187+
be sent.
188+
deliver_time (google.protobuf.timestamp_pb2.Timestamp):
189+
The time at which Spanner will begin attempting to deliver
190+
the message. If ``deliver_time`` is not set, Spanner will
191+
deliver the message immediately. If ``deliver_time`` is in
192+
the past, Spanner will replace it with a value closer to the
193+
current time.
194+
payload (google.protobuf.struct_pb2.Value):
195+
The payload of the message.
196+
"""
197+
198+
queue: str = proto.Field(
199+
proto.STRING,
200+
number=1,
201+
)
202+
key: struct_pb2.ListValue = proto.Field(
203+
proto.MESSAGE,
204+
number=2,
205+
message=struct_pb2.ListValue,
206+
)
207+
deliver_time: timestamp_pb2.Timestamp = proto.Field(
208+
proto.MESSAGE,
209+
number=3,
210+
message=timestamp_pb2.Timestamp,
211+
)
212+
payload: struct_pb2.Value = proto.Field(
213+
proto.MESSAGE,
214+
number=4,
215+
message=struct_pb2.Value,
216+
)
217+
218+
class Ack(proto.Message):
219+
r"""Arguments to [ack][google.spanner.v1.Mutation.ack] operations.
220+
221+
Attributes:
222+
queue (str):
223+
Required. The queue where the message to be
224+
acked is stored.
225+
key (google.protobuf.struct_pb2.ListValue):
226+
Required. The primary key of the message to
227+
be acked.
228+
ignore_not_found (bool):
229+
By default, an attempt to ack a message that does not exist
230+
will fail with a ``NOT_FOUND`` error. With
231+
``ignore_not_found`` set to true, the ack will succeed even
232+
if the message does not exist. This is useful for
233+
unconditionally acking a message, even if it is missing or
234+
has already been acked.
235+
"""
236+
237+
queue: str = proto.Field(
238+
proto.STRING,
239+
number=1,
240+
)
241+
key: struct_pb2.ListValue = proto.Field(
242+
proto.MESSAGE,
243+
number=2,
244+
message=struct_pb2.ListValue,
245+
)
246+
ignore_not_found: bool = proto.Field(
247+
proto.BOOL,
248+
number=3,
249+
)
250+
169251
insert: Write = proto.Field(
170252
proto.MESSAGE,
171253
number=1,
@@ -196,6 +278,18 @@ class Delete(proto.Message):
196278
oneof="operation",
197279
message=Delete,
198280
)
281+
send: Send = proto.Field(
282+
proto.MESSAGE,
283+
number=6,
284+
oneof="operation",
285+
message=Send,
286+
)
287+
ack: Ack = proto.Field(
288+
proto.MESSAGE,
289+
number=7,
290+
oneof="operation",
291+
message=Ack,
292+
)
199293

200294

201295
__all__ = tuple(sorted(__protobuf__.manifest))

‎google/cloud/spanner_v1/types/query_plan.py‎

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
package="google.spanner.v1",
2727
manifest={
2828
"PlanNode",
29+
"QueryAdvisorResult",
2930
"QueryPlan",
3031
},
3132
)
@@ -198,6 +199,49 @@ class ShortRepresentation(proto.Message):
198199
)
199200

200201

202+
class QueryAdvisorResult(proto.Message):
203+
r"""Output of query advisor analysis.
204+
205+
Attributes:
206+
index_advice (MutableSequence[google.cloud.spanner_v1.types.QueryAdvisorResult.IndexAdvice]):
207+
Optional. Index Recommendation for a query.
208+
This is an optional field and the recommendation
209+
will only be available when the recommendation
210+
guarantees significant improvement in query
211+
performance.
212+
"""
213+
214+
class IndexAdvice(proto.Message):
215+
r"""Recommendation to add new indexes to run queries more
216+
efficiently.
217+
218+
Attributes:
219+
ddl (MutableSequence[str]):
220+
Optional. DDL statements to add new indexes
221+
that will improve the query.
222+
improvement_factor (float):
223+
Optional. Estimated latency improvement
224+
factor. For example if the query currently takes
225+
500 ms to run and the estimated latency with new
226+
indexes is 100 ms this field will be 5.
227+
"""
228+
229+
ddl: MutableSequence[str] = proto.RepeatedField(
230+
proto.STRING,
231+
number=1,
232+
)
233+
improvement_factor: float = proto.Field(
234+
proto.DOUBLE,
235+
number=2,
236+
)
237+
238+
index_advice: MutableSequence[IndexAdvice] = proto.RepeatedField(
239+
proto.MESSAGE,
240+
number=1,
241+
message=IndexAdvice,
242+
)
243+
244+
201245
class QueryPlan(proto.Message):
202246
r"""Contains an ordered list of nodes appearing in the query
203247
plan.
@@ -208,13 +252,22 @@ class QueryPlan(proto.Message):
208252
pre-order starting with the plan root. Each
209253
[PlanNode][google.spanner.v1.PlanNode]'s ``id`` corresponds
210254
to its index in ``plan_nodes``.
255+
query_advice (google.cloud.spanner_v1.types.QueryAdvisorResult):
256+
Optional. The advise/recommendations for a
257+
query. Currently this field will be serving
258+
index recommendations for a query.
211259
"""
212260

213261
plan_nodes: MutableSequence["PlanNode"] = proto.RepeatedField(
214262
proto.MESSAGE,
215263
number=1,
216264
message="PlanNode",
217265
)
266+
query_advice: "QueryAdvisorResult" = proto.Field(
267+
proto.MESSAGE,
268+
number=2,
269+
message="QueryAdvisorResult",
270+
)
218271

219272

220273
__all__ = tuple(sorted(__protobuf__.manifest))

0 commit comments

Comments
 (0)