Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 9d2338a

Browse filesBrowse files
authored
chore: librarian generate pull request: 20260325T173440Z (#1529)
PR created by the Librarian CLI to generate Cloud Client Libraries code from protos. BEGIN_COMMIT BEGIN_NESTED_COMMIT docs: A comment for field `routing_hint` in messages `.google.spanner.v1.ResultSet` and `.google.spanner.v1.PartialResultSet` are changed PiperOrigin-RevId: 878019893 Library-IDs: google-cloud-spanner Source-link: [googleapis/googleapis@5c9602db](googleapis/googleapis@5c9602db) END_NESTED_COMMIT BEGIN_NESTED_COMMIT docs: A comment in message `.google.spanner.v1.TransactionOptions.ReadWrite.ReadLockMode` is changed PiperOrigin-RevId: 878019893 Library-IDs: google-cloud-spanner Source-link: [googleapis/googleapis@5c9602db](googleapis/googleapis@5c9602db) END_NESTED_COMMIT BEGIN_NESTED_COMMIT feat: include cache updates and routing hint into BeginTransaction and Commit request/response respectively PiperOrigin-RevId: 878019893 Library-IDs: google-cloud-spanner Source-link: [googleapis/googleapis@5c9602db](googleapis/googleapis@5c9602db) END_NESTED_COMMIT BEGIN_NESTED_COMMIT docs: A comment for field `params` in message `.google.spanner.v1.PartitionQueryRequest` is changed PiperOrigin-RevId: 865546011 Library-IDs: google-cloud-spanner Source-link: [googleapis/googleapis@8d30990f](googleapis/googleapis@8d30990f) END_NESTED_COMMIT BEGIN_NESTED_COMMIT feat: include cache updates into the ResultSet response PiperOrigin-RevId: 865546011 Library-IDs: google-cloud-spanner Source-link: [googleapis/googleapis@8d30990f](googleapis/googleapis@8d30990f) END_NESTED_COMMIT BEGIN_NESTED_COMMIT docs: A comment for field `transaction_tag` in message `.google.spanner.v1.RequestOptions` is changed PiperOrigin-RevId: 865546011 Library-IDs: google-cloud-spanner Source-link: [googleapis/googleapis@8d30990f](googleapis/googleapis@8d30990f) END_NESTED_COMMIT BEGIN_NESTED_COMMIT docs: A comment for field `param_types` in message `.google.spanner.v1.PartitionQueryRequest` is changed PiperOrigin-RevId: 865546011 Library-IDs: google-cloud-spanner Source-link: [googleapis/googleapis@8d30990f](googleapis/googleapis@8d30990f) END_NESTED_COMMIT BEGIN_NESTED_COMMIT docs: A comment for field `commit_timestamp` in message `.google.spanner.v1.BatchWriteResponse` is changed PiperOrigin-RevId: 865546011 Library-IDs: google-cloud-spanner Source-link: [googleapis/googleapis@8d30990f](googleapis/googleapis@8d30990f) END_NESTED_COMMIT BEGIN_NESTED_COMMIT chore: adjust initial_poll_delay for CreateDatabase and UpdateDatabaseDdl LRO operations PiperOrigin-RevId: 853884590 Library-IDs: google-cloud-spanner Source-link: [googleapis/googleapis@136a2c43](googleapis/googleapis@136a2c43) END_NESTED_COMMIT BEGIN_NESTED_COMMIT feat: add a ClientContext field to Spanner requests PiperOrigin-RevId: 853323071 Library-IDs: google-cloud-spanner Source-link: [googleapis/googleapis@211d22fa](googleapis/googleapis@211d22fa) END_NESTED_COMMIT BEGIN_NESTED_COMMIT feat: add Secure Parameters to the ClientContext PiperOrigin-RevId: 853323071 Library-IDs: google-cloud-spanner Source-link: [googleapis/googleapis@211d22fa](googleapis/googleapis@211d22fa) END_NESTED_COMMIT BEGIN_NESTED_COMMIT feat: Exposing total CPU related fields in AutoscalingConfig PiperOrigin-RevId: 845819318 Library-IDs: google-cloud-spanner Source-link: [googleapis/googleapis@6e20492a](googleapis/googleapis@6e20492a) END_NESTED_COMMIT BEGIN_NESTED_COMMIT docs: Update high_priority_cpu_utilization_percent in AutoscalingConfig to be Optional and clarify its behavior when not specified PiperOrigin-RevId: 845819318 Library-IDs: google-cloud-spanner Source-link: [googleapis/googleapis@6e20492a](googleapis/googleapis@6e20492a) END_NESTED_COMMIT BEGIN_NESTED_COMMIT docs: minor update for Spanner Location API PiperOrigin-RevId: 834841888 Library-IDs: google-cloud-spanner Source-link: [googleapis/googleapis@ded7ed1e](googleapis/googleapis@ded7ed1e) END_NESTED_COMMIT END_COMMIT This pull request is generated with proto changes between [googleapis/googleapis@a17b84ad](googleapis/googleapis@a17b84a) (exclusive) and [googleapis/googleapis@5c9602db](googleapis/googleapis@5c9602d) (inclusive). Librarian Version: v1.0.2-0.20260309131826-42ac5c451239 Language Image: us-central1-docker.pkg.dev/cloud-sdk-librarian-prod/images-prod/python-librarian-generator@sha256:b8058df4c45e9a6e07f6b4d65b458d0d059241dd34c814f151c8bf6b89211209 Fixes googleapis/python-spanner#1527 This PR also moves `ClientContext` under `RequestOptions` as per googleapis/python-spanner#1527 (comment). `ClientContext` was added in googleapis/python-spanner#1499 but the feature has not been released yet so it is safe to move.
1 parent c8f936b commit 9d2338a
Copy full SHA for 9d2338a

13 files changed

+358-126Lines changed: 358 additions & 126 deletions

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎packages/google-cloud-spanner/.librarian/generator-input/librarian.py‎

Copy file name to clipboardExpand all lines: packages/google-cloud-spanner/.librarian/generator-input/librarian.py
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -250,4 +250,4 @@
250250

251251
# Use a python runtime which is available in the owlbot post processor here
252252
# https://github.com/googleapis/synthtool/blob/master/docker/owlbot/python/Dockerfile
253-
s.shell.run(["nox", "-s", "blacken-3.14"], hide_output=False)
253+
s.shell.run(["nox", "-s", "format-3.14"], hide_output=False)
Collapse file

‎packages/google-cloud-spanner/.librarian/generator-input/noxfile.py‎

Copy file name to clipboardExpand all lines: packages/google-cloud-spanner/.librarian/generator-input/noxfile.py
+73-10Lines changed: 73 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
# See the License for the specific language governing permissions and
1515
# limitations under the License.
1616

17+
1718
# Generated by synthtool. DO NOT EDIT!
1819

1920
from __future__ import absolute_import
@@ -64,6 +65,7 @@
6465
SYSTEM_TEST_STANDARD_DEPENDENCIES: List[str] = [
6566
"mock",
6667
"pytest",
68+
"pytest-asyncio",
6769
"google-cloud-testutils",
6870
]
6971
SYSTEM_TEST_EXTERNAL_DEPENDENCIES: List[str] = []
@@ -217,9 +219,8 @@ def unit(session, protobuf_implementation):
217219
session.install("protobuf<4")
218220

219221
# Run py.test against the unit tests.
220-
session.run(
222+
args = [
221223
"py.test",
222-
"--quiet",
223224
"-s",
224225
f"--junitxml=unit_{session.python}_sponge_log.xml",
225226
"--cov=google",
@@ -228,8 +229,13 @@ def unit(session, protobuf_implementation):
228229
"--cov-config=.coveragerc",
229230
"--cov-report=",
230231
"--cov-fail-under=0",
231-
os.path.join("tests", "unit"),
232-
*session.posargs,
232+
]
233+
if not session.posargs:
234+
args.append(os.path.join("tests", "unit"))
235+
args.extend(session.posargs)
236+
237+
session.run(
238+
*args,
233239
env={
234240
"PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION": protobuf_implementation,
235241
},
@@ -362,25 +368,67 @@ def system(session, protobuf_implementation, database_dialect):
362368

363369
# Run py.test against the system tests.
364370
if system_test_exists:
365-
session.run(
371+
args = [
366372
"py.test",
367373
"--quiet",
374+
"-o",
375+
"asyncio_mode=auto",
368376
f"--junitxml=system_{session.python}_sponge_log.xml",
369-
system_test_path,
370-
*session.posargs,
377+
]
378+
if not session.posargs:
379+
args.append(system_test_path)
380+
args.extend(session.posargs)
381+
382+
session.run(
383+
*args,
371384
env={
372385
"PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION": protobuf_implementation,
373386
"SPANNER_DATABASE_DIALECT": database_dialect,
374387
"SKIP_BACKUP_TESTS": "true",
375388
},
376389
)
377390
elif system_test_folder_exists:
391+
# Run sync tests
392+
sync_args = [
393+
"py.test",
394+
"--quiet",
395+
"-o",
396+
"asyncio_mode=auto",
397+
f"--junitxml=system_{session.python}_sync_sponge_log.xml",
398+
]
399+
if not session.posargs:
400+
sync_args.append(os.path.join("tests", "system"))
401+
sync_args.append("--ignore=tests/system/_async")
402+
else:
403+
sync_args.extend(session.posargs)
404+
378405
session.run(
406+
*sync_args,
407+
env={
408+
"PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION": protobuf_implementation,
409+
"SPANNER_DATABASE_DIALECT": database_dialect,
410+
"SKIP_BACKUP_TESTS": "true",
411+
},
412+
)
413+
414+
# Run async tests
415+
async_args = [
379416
"py.test",
380417
"--quiet",
381-
f"--junitxml=system_{session.python}_sponge_log.xml",
382-
system_test_folder_path,
383-
*session.posargs,
418+
"-o",
419+
"asyncio_mode=auto",
420+
f"--junitxml=system_{session.python}_async_sponge_log.xml",
421+
]
422+
if not session.posargs:
423+
async_args.append(os.path.join("tests", "system", "_async"))
424+
else:
425+
# If posargs are provided, only run if they match async tests
426+
# or just skip if they were already run in sync.
427+
# For simplicity, we only run async folder if no posargs.
428+
return
429+
430+
session.run(
431+
*async_args,
384432
env={
385433
"PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION": protobuf_implementation,
386434
"SPANNER_DATABASE_DIALECT": database_dialect,
@@ -551,6 +599,10 @@ def prerelease_deps(session, protobuf_implementation, database_dialect):
551599
"google-cloud-testutils",
552600
# dependencies of google-cloud-testutils"
553601
"click",
602+
# dependency of google-auth
603+
"cffi",
604+
"cryptography",
605+
"cachetools",
554606
]
555607

556608
for dep in prerel_deps:
@@ -589,6 +641,8 @@ def prerelease_deps(session, protobuf_implementation, database_dialect):
589641
session.run(
590642
"py.test",
591643
"--verbose",
644+
"-o",
645+
"asyncio_mode=auto",
592646
f"--junitxml=system_{session.python}_sponge_log.xml",
593647
system_test_path,
594648
*session.posargs,
@@ -602,6 +656,8 @@ def prerelease_deps(session, protobuf_implementation, database_dialect):
602656
session.run(
603657
"py.test",
604658
"--verbose",
659+
"-o",
660+
"asyncio_mode=auto",
605661
f"--junitxml=system_{session.python}_sponge_log.xml",
606662
system_test_folder_path,
607663
*session.posargs,
@@ -611,3 +667,10 @@ def prerelease_deps(session, protobuf_implementation, database_dialect):
611667
"SKIP_BACKUP_TESTS": "true",
612668
},
613669
)
670+
671+
672+
@nox.session(python=DEFAULT_PYTHON_VERSION)
673+
def generate(session):
674+
"""Regenerate synchronous code from asynchronous code."""
675+
session.install("black", "autoflake")
676+
session.run("python", ".cross_sync/generate.py", "google/cloud/spanner_v1")
Collapse file

‎packages/google-cloud-spanner/.librarian/state.yaml‎

Copy file name to clipboardExpand all lines: packages/google-cloud-spanner/.librarian/state.yaml
+3-2Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ image: us-central1-docker.pkg.dev/cloud-sdk-librarian-prod/images-prod/python-li
22
libraries:
33
- id: google-cloud-spanner
44
version: 3.63.0
5-
last_generated_commit: a17b84add8318f780fcc8a027815d5fee644b9f7
5+
last_generated_commit: 94bc991b3f1df58bc841801631715894a7ac5e28
66
apis:
77
- path: google/spanner/admin/instance/v1
88
service_config: spanner.yaml
@@ -21,7 +21,8 @@ libraries:
2121
- ^google/cloud/spanner_v1/types
2222
- ^google/cloud/spanner_admin_database_v1
2323
- ^google/cloud/spanner_admin_instance_v1
24-
- ^tests/unit/gapic
24+
- ^tests/unit/gapic/spanner
25+
- ^tests/unit/gapic/__init__.py
2526
- ^tests/__init__.py
2627
- ^tests/unit/__init__.py
2728
- ^.pre-commit-config.yaml
Collapse file

‎packages/google-cloud-spanner/google/cloud/spanner_admin_instance_v1/types/spanner_instance_admin.py‎

Copy file name to clipboardExpand all lines: packages/google-cloud-spanner/google/cloud/spanner_admin_instance_v1/types/spanner_instance_admin.py
+83-2Lines changed: 83 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -542,11 +542,24 @@ class AutoscalingTargets(proto.Message):
542542
543543
Attributes:
544544
high_priority_cpu_utilization_percent (int):
545-
Required. The target high priority cpu utilization
545+
Optional. The target high priority cpu utilization
546546
percentage that the autoscaler should be trying to achieve
547547
for the instance. This number is on a scale from 0 (no
548548
utilization) to 100 (full utilization). The valid range is
549-
[10, 90] inclusive.
549+
[10, 90] inclusive. If not specified or set to 0, the
550+
autoscaler skips scaling based on high priority CPU
551+
utilization.
552+
total_cpu_utilization_percent (int):
553+
Optional. The target total CPU utilization percentage that
554+
the autoscaler should be trying to achieve for the instance.
555+
This number is on a scale from 0 (no utilization) to 100
556+
(full utilization). The valid range is [10, 90] inclusive.
557+
If not specified or set to 0, the autoscaler skips scaling
558+
based on total CPU utilization. If both
559+
``high_priority_cpu_utilization_percent`` and
560+
``total_cpu_utilization_percent`` are specified, the
561+
autoscaler provisions the larger of the two required compute
562+
capacities to satisfy both targets.
550563
storage_utilization_percent (int):
551564
Required. The target storage utilization percentage that the
552565
autoscaler should be trying to achieve for the instance.
@@ -558,6 +571,10 @@ class AutoscalingTargets(proto.Message):
558571
proto.INT32,
559572
number=1,
560573
)
574+
total_cpu_utilization_percent: int = proto.Field(
575+
proto.INT32,
576+
number=4,
577+
)
561578
storage_utilization_percent: int = proto.Field(
562579
proto.INT32,
563580
number=2,
@@ -593,6 +610,58 @@ class AutoscalingConfigOverrides(proto.Message):
593610
Optional. If specified, overrides the autoscaling target
594611
high_priority_cpu_utilization_percent in the top-level
595612
autoscaling configuration for the selected replicas.
613+
autoscaling_target_total_cpu_utilization_percent (int):
614+
Optional. If specified, overrides the autoscaling target
615+
``total_cpu_utilization_percent`` in the top-level
616+
autoscaling configuration for the selected replicas.
617+
disable_high_priority_cpu_autoscaling (bool):
618+
Optional. If true, disables high priority CPU autoscaling
619+
for the selected replicas and ignores
620+
[high_priority_cpu_utilization_percent][google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingTargets.high_priority_cpu_utilization_percent]
621+
in the top-level autoscaling configuration.
622+
623+
When setting this field to true, setting
624+
[autoscaling_target_high_priority_cpu_utilization_percent][google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.AutoscalingConfigOverrides.autoscaling_target_high_priority_cpu_utilization_percent]
625+
field to a non-zero value for the same replica is not
626+
supported.
627+
628+
If false, the
629+
[autoscaling_target_high_priority_cpu_utilization_percent][google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.AutoscalingConfigOverrides.autoscaling_target_high_priority_cpu_utilization_percent]
630+
field in the replica will be used if set to a non-zero
631+
value. Otherwise, the
632+
[high_priority_cpu_utilization_percent][google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingTargets.high_priority_cpu_utilization_percent]
633+
field in the top-level autoscaling configuration will be
634+
used.
635+
636+
Setting both
637+
[disable_high_priority_cpu_autoscaling][google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.AutoscalingConfigOverrides.disable_high_priority_cpu_autoscaling]
638+
and
639+
[disable_total_cpu_autoscaling][google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.AutoscalingConfigOverrides.disable_total_cpu_autoscaling]
640+
to true for the same replica is not supported.
641+
disable_total_cpu_autoscaling (bool):
642+
Optional. If true, disables total CPU autoscaling for the
643+
selected replicas and ignores
644+
[total_cpu_utilization_percent][google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingTargets.total_cpu_utilization_percent]
645+
in the top-level autoscaling configuration.
646+
647+
When setting this field to true, setting
648+
[autoscaling_target_total_cpu_utilization_percent][google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.AutoscalingConfigOverrides.autoscaling_target_total_cpu_utilization_percent]
649+
field to a non-zero value for the same replica is not
650+
supported.
651+
652+
If false, the
653+
[autoscaling_target_total_cpu_utilization_percent][google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.AutoscalingConfigOverrides.autoscaling_target_total_cpu_utilization_percent]
654+
field in the replica will be used if set to a non-zero
655+
value. Otherwise, the
656+
[total_cpu_utilization_percent][google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingTargets.total_cpu_utilization_percent]
657+
field in the top-level autoscaling configuration will be
658+
used.
659+
660+
Setting both
661+
[disable_high_priority_cpu_autoscaling][google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.AutoscalingConfigOverrides.disable_high_priority_cpu_autoscaling]
662+
and
663+
[disable_total_cpu_autoscaling][google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.AutoscalingConfigOverrides.disable_total_cpu_autoscaling]
664+
to true for the same replica is not supported.
596665
"""
597666

598667
autoscaling_limits: "AutoscalingConfig.AutoscalingLimits" = proto.Field(
@@ -604,6 +673,18 @@ class AutoscalingConfigOverrides(proto.Message):
604673
proto.INT32,
605674
number=2,
606675
)
676+
autoscaling_target_total_cpu_utilization_percent: int = proto.Field(
677+
proto.INT32,
678+
number=4,
679+
)
680+
disable_high_priority_cpu_autoscaling: bool = proto.Field(
681+
proto.BOOL,
682+
number=5,
683+
)
684+
disable_total_cpu_autoscaling: bool = proto.Field(
685+
proto.BOOL,
686+
number=6,
687+
)
607688

608689
replica_selection: common.ReplicaSelection = proto.Field(
609690
proto.MESSAGE,
Collapse file

‎packages/google-cloud-spanner/google/cloud/spanner_v1/__init__.py‎

Copy file name to clipboardExpand all lines: packages/google-cloud-spanner/google/cloud/spanner_v1/__init__.py
-2Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,6 @@
6363
BatchWriteRequest,
6464
BatchWriteResponse,
6565
BeginTransactionRequest,
66-
ClientContext,
6766
CommitRequest,
6867
CreateSessionRequest,
6968
DeleteSessionRequest,
@@ -124,7 +123,6 @@
124123
"BatchWriteRequest",
125124
"BatchWriteResponse",
126125
"BeginTransactionRequest",
127-
"ClientContext",
128126
"CommitRequest",
129127
"CommitResponse",
130128
"CreateSessionRequest",

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.