Skip to content
This repository was archived by the owner on Mar 31, 2026. It is now read-only.

Commit 85f96cd

Browse files
authored
Merge branch 'main' into main
2 parents 7589577 + 234135d commit 85f96cd

File tree

231 files changed

+4229
-869
lines changed

Some content is hidden

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

231 files changed

+4229
-869
lines changed
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
on:
2+
push:
3+
branches:
4+
- main
5+
pull_request:
6+
name: Run Spanner integration tests against emulator with multiplexed sessions
7+
jobs:
8+
system-tests:
9+
runs-on: ubuntu-latest
10+
11+
services:
12+
emulator:
13+
image: gcr.io/cloud-spanner-emulator/emulator:latest
14+
ports:
15+
- 9010:9010
16+
- 9020:9020
17+
18+
steps:
19+
- name: Checkout code
20+
uses: actions/checkout@v4
21+
- name: Setup Python
22+
uses: actions/setup-python@v5
23+
with:
24+
python-version: 3.8
25+
- name: Install nox
26+
run: python -m pip install nox
27+
- name: Run system tests
28+
run: nox -s system
29+
env:
30+
SPANNER_EMULATOR_HOST: localhost:9010
31+
GOOGLE_CLOUD_PROJECT: emulator-test-project
32+
GOOGLE_CLOUD_TESTS_CREATE_SPANNER_INSTANCE: true
33+
GOOGLE_CLOUD_SPANNER_MULTIPLEXED_SESSIONS: true
34+
GOOGLE_CLOUD_SPANNER_MULTIPLEXED_SESSIONS_PARTITIONED_OPS: true
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Format: //devtools/kokoro/config/proto/build.proto
2+
3+
# Only run a subset of all nox sessions
4+
env_vars: {
5+
key: "NOX_SESSION"
6+
value: "unit-3.8 unit-3.12 system-3.8"
7+
}
8+
9+
env_vars: {
10+
key: "GOOGLE_CLOUD_SPANNER_MULTIPLEXED_SESSIONS"
11+
value: "true"
12+
}
13+
14+
env_vars: {
15+
key: "GOOGLE_CLOUD_SPANNER_MULTIPLEXED_SESSIONS_PARTITIONED_OPS"
16+
value: "true"
17+
}

.release-please-manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
".": "3.54.0"
2+
".": "3.55.0"
33
}

CHANGELOG.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,40 @@
44

55
[1]: https://pypi.org/project/google-cloud-spanner/#history
66

7+
## [3.55.0](https://github.com/googleapis/python-spanner/compare/v3.54.0...v3.55.0) (2025-05-28)
8+
9+
10+
### Features
11+
12+
* Add a `last` field in the `PartialResultSet` ([d532d57](https://github.com/googleapis/python-spanner/commit/d532d57fd5908ecd7bc9dfff73695715cc4b1ebe))
13+
* Add support for multiplexed sessions ([#1381](https://github.com/googleapis/python-spanner/issues/1381)) ([97d7268](https://github.com/googleapis/python-spanner/commit/97d7268ac12a57d9d116ee3d9475580e1e7e07ae))
14+
* Add throughput_mode to UpdateDatabaseDdlRequest to be used by Spanner Migration Tool. See https://github.com/GoogleCloudPlatform/spanner-migration-tool ([d532d57](https://github.com/googleapis/python-spanner/commit/d532d57fd5908ecd7bc9dfff73695715cc4b1ebe))
15+
* Support fine-grained permissions database roles in connect ([#1338](https://github.com/googleapis/python-spanner/issues/1338)) ([064d9dc](https://github.com/googleapis/python-spanner/commit/064d9dc3441a617cbc80af6e16493bc42c89b3c9))
16+
17+
18+
### Bug Fixes
19+
20+
* E2E tracing metadata append issue ([#1357](https://github.com/googleapis/python-spanner/issues/1357)) ([3943885](https://github.com/googleapis/python-spanner/commit/394388595a312f60b423dfbfd7aaf2724cc4454f))
21+
* Pass through kwargs in dbapi connect ([#1368](https://github.com/googleapis/python-spanner/issues/1368)) ([aae8d61](https://github.com/googleapis/python-spanner/commit/aae8d6161580c88354d813fe75a297c318f1c2c7))
22+
* Remove setup.cfg configuration for creating universal wheels ([#1324](https://github.com/googleapis/python-spanner/issues/1324)) ([e064474](https://github.com/googleapis/python-spanner/commit/e0644744d7f3fcea42b461996fc0ee22d4218599))
23+
24+
25+
### Documentation
26+
27+
* A comment for field `chunked_value` in message `.google.spanner.v1.PartialResultSet` is changed ([d532d57](https://github.com/googleapis/python-spanner/commit/d532d57fd5908ecd7bc9dfff73695715cc4b1ebe))
28+
* A comment for field `precommit_token` in message `.google.spanner.v1.PartialResultSet` is changed ([d532d57](https://github.com/googleapis/python-spanner/commit/d532d57fd5908ecd7bc9dfff73695715cc4b1ebe))
29+
* A comment for field `precommit_token` in message `.google.spanner.v1.ResultSet` is changed ([d532d57](https://github.com/googleapis/python-spanner/commit/d532d57fd5908ecd7bc9dfff73695715cc4b1ebe))
30+
* A comment for field `query_plan` in message `.google.spanner.v1.ResultSetStats` is changed ([d532d57](https://github.com/googleapis/python-spanner/commit/d532d57fd5908ecd7bc9dfff73695715cc4b1ebe))
31+
* A comment for field `row_count_lower_bound` in message `.google.spanner.v1.ResultSetStats` is changed ([d532d57](https://github.com/googleapis/python-spanner/commit/d532d57fd5908ecd7bc9dfff73695715cc4b1ebe))
32+
* A comment for field `row_type` in message `.google.spanner.v1.ResultSetMetadata` is changed ([d532d57](https://github.com/googleapis/python-spanner/commit/d532d57fd5908ecd7bc9dfff73695715cc4b1ebe))
33+
* A comment for field `rows` in message `.google.spanner.v1.ResultSet` is changed ([d532d57](https://github.com/googleapis/python-spanner/commit/d532d57fd5908ecd7bc9dfff73695715cc4b1ebe))
34+
* A comment for field `stats` in message `.google.spanner.v1.PartialResultSet` is changed ([d532d57](https://github.com/googleapis/python-spanner/commit/d532d57fd5908ecd7bc9dfff73695715cc4b1ebe))
35+
* A comment for field `stats` in message `.google.spanner.v1.ResultSet` is changed ([d532d57](https://github.com/googleapis/python-spanner/commit/d532d57fd5908ecd7bc9dfff73695715cc4b1ebe))
36+
* A comment for field `values` in message `.google.spanner.v1.PartialResultSet` is changed ([d532d57](https://github.com/googleapis/python-spanner/commit/d532d57fd5908ecd7bc9dfff73695715cc4b1ebe))
37+
* A comment for message `ResultSetMetadata` is changed ([d532d57](https://github.com/googleapis/python-spanner/commit/d532d57fd5908ecd7bc9dfff73695715cc4b1ebe))
38+
* A comment for message `ResultSetStats` is changed ([d532d57](https://github.com/googleapis/python-spanner/commit/d532d57fd5908ecd7bc9dfff73695715cc4b1ebe))
39+
* Fix markdown formatting in transactions page ([#1377](https://github.com/googleapis/python-spanner/issues/1377)) ([de322f8](https://github.com/googleapis/python-spanner/commit/de322f89642a3c13b6b1d4b9b1a2cdf4c8f550fb))
40+
741
## [3.54.0](https://github.com/googleapis/python-spanner/compare/v3.53.0...v3.54.0) (2025-04-28)
842

943

README.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -252,6 +252,13 @@ Connection API represents a wrap-around for Python Spanner API, written in accor
252252
result = cursor.fetchall()
253253
254254
255+
If using [fine-grained access controls](https://cloud.google.com/spanner/docs/access-with-fgac) you can pass a ``database_role`` argument to connect as that role:
256+
257+
.. code:: python
258+
259+
connection = connect("instance-id", "database-id", database_role='your-role')
260+
261+
255262
Aborted Transactions Retry Mechanism
256263
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
257264

docs/transaction-usage.rst

Lines changed: 19 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ A :class:`~google.cloud.spanner_v1.transaction.Transaction` represents a
55
transaction: when the transaction commits, it will send any accumulated
66
mutations to the server.
77

8-
To understand more about how transactions work, visit [Transaction](https://cloud.google.com/spanner/docs/reference/rest/v1/Transaction).
8+
To understand more about how transactions work, visit
9+
`Transaction <https://cloud.google.com/spanner/docs/reference/rest/v1/Transaction>`_.
910
To learn more about how to use them in the Python client, continue reading.
1011

1112

@@ -90,8 +91,8 @@ any of the records already exists.
9091
Update records using a Transaction
9192
----------------------------------
9293

93-
:meth:`Transaction.update` updates one or more existing records in a table. Fails
94-
if any of the records does not already exist.
94+
:meth:`Transaction.update` updates one or more existing records in a table.
95+
Fails if any of the records does not already exist.
9596

9697
.. code:: python
9798
@@ -178,35 +179,40 @@ Using :meth:`~Database.run_in_transaction`
178179

179180
Rather than calling :meth:`~Transaction.commit` or :meth:`~Transaction.rollback`
180181
manually, you should use :meth:`~Database.run_in_transaction` to run the
181-
function that you need. The transaction's :meth:`~Transaction.commit` method
182+
function that you need. The transaction's :meth:`~Transaction.commit` method
182183
will be called automatically if the ``with`` block exits without raising an
183-
exception. The function will automatically be retried for
184+
exception. The function will automatically be retried for
184185
:class:`~google.api_core.exceptions.Aborted` errors, but will raise on
185186
:class:`~google.api_core.exceptions.GoogleAPICallError` and
186187
:meth:`~Transaction.rollback` will be called on all others.
187188

188189
.. code:: python
189190
190191
def _unit_of_work(transaction):
191-
192192
transaction.insert(
193-
'citizens', columns=['email', 'first_name', 'last_name', 'age'],
193+
'citizens',
194+
columns=['email', 'first_name', 'last_name', 'age'],
194195
values=[
195196
['phred@exammple.com', 'Phred', 'Phlyntstone', 32],
196197
['bharney@example.com', 'Bharney', 'Rhubble', 31],
197-
])
198+
]
199+
)
198200
199201
transaction.update(
200-
'citizens', columns=['email', 'age'],
202+
'citizens',
203+
columns=['email', 'age'],
201204
values=[
202205
['phred@exammple.com', 33],
203206
['bharney@example.com', 32],
204-
])
207+
]
208+
)
205209
206210
...
207211
208-
transaction.delete('citizens',
209-
keyset['bharney@example.com', 'nonesuch@example.com'])
212+
transaction.delete(
213+
'citizens',
214+
keyset=['bharney@example.com', 'nonesuch@example.com']
215+
)
210216
211217
db.run_in_transaction(_unit_of_work)
212218
@@ -242,7 +248,7 @@ If an exception is raised inside the ``with`` block, the transaction's
242248
...
243249
244250
transaction.delete('citizens',
245-
keyset['bharney@example.com', 'nonesuch@example.com'])
251+
keyset=['bharney@example.com', 'nonesuch@example.com'])
246252
247253
248254
Begin a Transaction

google/cloud/spanner_admin_database_v1/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
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.

google/cloud/spanner_admin_database_v1/gapic_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@
1313
# See the License for the specific language governing permissions and
1414
# limitations under the License.
1515
#
16-
__version__ = "3.54.0" # {x-release-please-version}
16+
__version__ = "3.55.0" # {x-release-please-version}

google/cloud/spanner_admin_database_v1/services/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
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.

google/cloud/spanner_admin_database_v1/services/database_admin/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
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.

0 commit comments

Comments
 (0)