Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
84 commits
Select commit Hold shift + click to select a range
4e8f7c5
Add spanner samples [(#804)](https://github.com/GoogleCloudPlatform/p…
Feb 14, 2017
7b81a23
Update snippets.py [(#815)](https://github.com/GoogleCloudPlatform/py…
jasonmorton Feb 22, 2017
e3e62a6
Changed read_write minimum amount to 300,000 as per bug [(#818)](http…
ryanmats Feb 22, 2017
9df9890
Remove cloud config fixture [(#887)](https://github.com/GoogleCloudPl…
Apr 4, 2017
1ded769
Fix reference to our testing tools
Apr 12, 2017
5346f6b
Auto-update dependencies. [(#914)](https://github.com/GoogleCloudPlat…
dpebot Apr 24, 2017
dc391f9
Re-generate all readmes
Apr 27, 2017
7391845
Auto-update dependencies. [(#922)](https://github.com/GoogleCloudPlat…
dpebot May 1, 2017
3337ecb
Update spanner sample to use bind parameters [(#928)](https://github.…
May 3, 2017
fb68a54
Fix default arguments
May 5, 2017
2b46e90
Fix README rst links [(#962)](https://github.com/GoogleCloudPlatform/…
waprin May 24, 2017
7db79ec
Auto-update dependencies. [(#992)](https://github.com/GoogleCloudPlat…
dpebot Jun 17, 2017
8a35c27
Auto-update dependencies. [(#1004)](https://github.com/GoogleCloudPla…
dpebot Jun 27, 2017
278b6ce
Swap the album titles to be consistent with other samples [(#1035)](h…
Jul 27, 2017
ba6d34f
Auto-update dependencies. [(#1055)](https://github.com/GoogleCloudPla…
dpebot Aug 7, 2017
59a4e04
Pass multi_use=True to spanner read-only transaction [(#1063)](https:…
Aug 8, 2017
4e22fb1
fix typo
Aug 8, 2017
a8ce453
Auto-update dependencies. [(#1093)](https://github.com/GoogleCloudPla…
dpebot Aug 29, 2017
211387d
Add spanner stale data sample [(#1107)](https://github.com/GoogleClou…
Sep 12, 2017
8147700
Update all generated readme auth instructions [(#1121)](https://githu…
Sep 18, 2017
80ca3db
Added Link to Python Setup Guide [(#1158)](https://github.com/GoogleC…
Oct 12, 2017
dc8a99c
Auto-update dependencies. [(#1138)](https://github.com/GoogleCloudPla…
dpebot Oct 23, 2017
52e04c6
Auto-update dependencies. [(#1186)](https://github.com/GoogleCloudPla…
dpebot Nov 1, 2017
dae800f
Fixed failed tests on Kokoro (Spanner + Translate) [(#1192)](https://…
Nov 3, 2017
0af87b2
Bump spanner stale read from 10 to 15 seconds. [(#1207)](https://gith…
SurferJeffAtGoogle Nov 9, 2017
52d825c
Added "Open in Cloud Shell" buttons to README files [(#1254)](https:/…
Dec 7, 2017
16a87a6
Auto-update dependencies. [(#1316)](https://github.com/GoogleCloudPla…
dpebot Jan 12, 2018
2e1ee6c
Auto-update dependencies. [(#1354)](https://github.com/GoogleCloudPla…
dpebot Feb 8, 2018
9640e96
Add Spanner region tags. [(#1376)](https://github.com/GoogleCloudPlat…
jmdobry Mar 1, 2018
9381802
Auto-update dependencies. [(#1377)](https://github.com/GoogleCloudPla…
dpebot Mar 5, 2018
9c217e3
Spanner Batch Query Sample [(#1402)](https://github.com/GoogleCloudPl…
kurtisvg Mar 15, 2018
7aba51c
Auto-update dependencies. [(#1406)](https://github.com/GoogleCloudPla…
dpebot Mar 16, 2018
a662787
Spanner Commit Timestamp Sample [(#1425)](https://github.com/GoogleCl…
kurtisvg Mar 27, 2018
cea767f
Regenerate the README files and fix the Open in Cloud Shell link for …
Apr 7, 2018
57d526e
Update READMEs to fix numbering and add git clone [(#1464)](https://g…
frankyn Apr 26, 2018
813f0a8
Adding Spanner STRUCT param samples [(#1519)](https://github.com/Goog…
jabubake Jun 13, 2018
07777ce
Fix python Cloud Spanner tests. [(#1548)](https://github.com/GoogleCl…
jsimonweb Jun 29, 2018
9924d57
Cleanup spanner tests. [(#1633)](https://github.com/GoogleCloudPlatfo…
kurtisvg Aug 21, 2018
0850798
Added Spanner DML/PDML samples. [(#1742)](https://github.com/GoogleC…
kurtisvg Oct 10, 2018
8b239e8
Update method name to match action. [(#1836)](https://github.com/Goo…
jsimonweb Nov 13, 2018
f083646
Auto-update dependencies. [(#1846)](https://github.com/GoogleCloudPla…
dpebot Nov 20, 2018
4224746
Add sample to delete data. [(#1872)](https://github.com/GoogleCloudPl…
RobinRH Dec 7, 2018
9d6fd8d
Auto-update dependencies. [(#1980)](https://github.com/GoogleCloudPla…
dpebot Feb 6, 2019
61136e4
Add Cloud Spanner Batch DML sample [(#2068)](https://github.com/Googl…
jsimonweb Mar 25, 2019
99bf094
Add queryWithParameter to Cloud Spanner sample. [(#2153)](https://git…
jsimonweb May 15, 2019
f8a828b
Deflake bigtable and spanner tests. [(#2224)](https://github.com/Goog…
theacodes Jun 14, 2019
7519b11
Improve and fix Cloud Spanner samples that transfer marketing budget …
hegemonic Jun 19, 2019
cd34847
Add Datatypes examples to Spanner sample. [(#2251)](https://github.co…
jsimonweb Jul 10, 2019
02fc4e6
Add bulk loading Python Sample [(#2295)](https://github.com/GoogleClo…
tonioshikanlu Aug 6, 2019
a2f1898
Fix Spanner `BOOL` example after upstream typo fix [(#2356)](https://…
wchargin Sep 5, 2019
3f0639c
Updates to spanner version with BOOL correctly spelled. [(#2392)](htt…
gguuss Sep 13, 2019
3560942
Adds updates for samples profiler ... vision [(#2439)](https://github…
gguuss Oct 7, 2019
9feca9a
update filenames to match the CSV files [(#2535)](https://github.com/…
mmmarklu Nov 16, 2019
83cdcda
Auto-update dependencies. [(#2005)](https://github.com/GoogleCloudPla…
dpebot Dec 21, 2019
2027631
Delete spanner/cloud-client/bulk_load_csv. [(#2721)](https://github.c…
lgruen Jan 17, 2020
15cff78
spanner: add query options versioning samples [(#3093)](https://githu…
larkee Mar 17, 2020
ef4c0e2
spanner: Add Cloud Spanner Backup samples [(#3101)](https://github.co…
larkee Mar 30, 2020
1d7fa0c
Simplify noxfile setup. [(#2806)](https://github.com/GoogleCloudPlatf…
kurtisvg Apr 2, 2020
44e81e8
Update dependency google-cloud-spanner to v1.15.1 [(#3377)](https://g…
renovate-bot Apr 13, 2020
ee0dca1
[spanner] fix: bump the timeout for instance creation [(#3468)](https…
Apr 23, 2020
2ecd360
[spanner] fix: set timeout for polling on operations [(#3488)](https:…
Apr 25, 2020
9dd04cf
fix: use DELETE FROM for consistency [(#3498)](https://github.com/Goo…
skuruppu Apr 28, 2020
bf24403
chore: pin new release [(#3688)](https://github.com/GoogleCloudPlatfo…
larkee May 5, 2020
006401d
chore: some lint fixes [(#3749)](https://github.com/GoogleCloudPlatfo…
May 13, 2020
2bec1d2
chore(deps): update dependency google-cloud-spanner to v1.17.0 [(#388…
renovate-bot May 27, 2020
a62c454
Improve Spanner delete_data sample coverage [(#3922)](https://github.…
larkee Jun 3, 2020
8cb43c0
chore(deps): update dependency google-cloud-spanner to v1.17.1 [(#416…
renovate-bot Jun 25, 2020
a54e210
fix(spanner): use uuid for unique id [(#4198)](https://github.com/Goo…
Jun 29, 2020
1e6670e
feat(spanner): add sample for create instance [(#4230)](https://githu…
larkee Jul 6, 2020
32ac0b0
chore(deps): update dependency pytest to v5.4.3 [(#4279)](https://git…
renovate-bot Jul 12, 2020
aebfbad
chore(deps): update dependency mock to v4 [(#4287)](https://github.co…
renovate-bot Jul 13, 2020
a29be24
test(spanner): add sleep to fix flaky test [(#4289)](https://github.c…
larkee Jul 13, 2020
36c762f
Update dependency pytest to v6 [(#4390)](https://github.com/GoogleClo…
renovate-bot Aug 1, 2020
31bd36a
fix(spanner): use future date to avoid time drift [(#4471)](https://g…
Aug 13, 2020
6be03ac
chore: fix some unmatched region tags [(#4584)](https://github.com/Go…
Aug 28, 2020
d3e2a27
chore(deps): update dependency google-cloud-spanner to v1.18.0 [(#456…
renovate-bot Aug 28, 2020
07b0064
chore(deps): update dependency google-cloud-spanner to v1.19.0 [(#464…
renovate-bot Sep 8, 2020
eb93255
test(spanner): fix flaky restore_database() sample test [(#4641)](htt…
larkee Sep 18, 2020
f90c03e
feat(spanner): add samples for NUMERIC type [(#4643)](https://github.…
larkee Sep 22, 2020
5aaefe4
Merge branch 'samples-samples' into add-samples-samples
larkee Sep 24, 2020
e1aeeb8
Merge branch 'master' into add-samples-samples
larkee Sep 24, 2020
3a59345
style: fix lint
larkee Sep 24, 2020
c9eeeee
refactor: remove repeated statements from rebase
larkee Sep 25, 2020
cbb3952
fix: correct table name
larkee Sep 25, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
118 changes: 73 additions & 45 deletions samples/samples/README.rst
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

.. This file is automatically generated. Do not edit this file directly.

Google Cloud Spanner Python Samples
Expand All @@ -15,12 +14,10 @@ This directory contains samples for Google Cloud Spanner. `Google Cloud Spanner`

.. _Google Cloud Spanner: https://cloud.google.com/spanner/docs


Setup
-------------------------------------------------------------------------------



Authentication
++++++++++++++

Expand All @@ -31,9 +28,6 @@ credentials for applications.
.. _Authentication Getting Started Guide:
https://cloud.google.com/docs/authentication/getting-started




Install Dependencies
++++++++++++++++++++

Expand All @@ -48,7 +42,7 @@ Install Dependencies
.. _Python Development Environment Setup Guide:
https://cloud.google.com/python/setup

#. Create a virtualenv. Samples are compatible with Python 3.6+.
#. Create a virtualenv. Samples are compatible with Python 2.7 and 3.4+.

.. code-block:: bash

Expand All @@ -64,15 +58,9 @@ Install Dependencies
.. _pip: https://pip.pypa.io/
.. _virtualenv: https://virtualenv.pypa.io/






Samples
-------------------------------------------------------------------------------


Snippets
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Expand All @@ -88,10 +76,32 @@ To run this sample:

$ python snippets.py


usage: snippets.py [-h] [--database-id DATABASE_ID]
instance_id
{create_instance,create_database,insert_data,delete_data,query_data,read_data,read_stale_data,add_column,update_data,query_data_with_new_column,read_write_transaction,read_only_transaction,add_index,query_data_with_index,read_data_with_index,add_storing_index,read_data_with_storing_index,create_table_with_timestamp,insert_data_with_timestamp,add_timestamp_column,update_data_with_timestamp,query_data_with_timestamp,write_struct_data,query_with_struct,query_with_array_of_struct,query_struct_field,query_nested_struct_field,insert_data_with_dml,update_data_with_dml,delete_data_with_dml,update_data_with_dml_timestamp,dml_write_read_transaction,update_data_with_dml_struct,insert_with_dml,query_data_with_parameter,write_with_dml_transaction,update_data_with_partitioned_dml,delete_data_with_partitioned_dml,update_with_batch_dml,create_table_with_datatypes,insert_datatypes_data,query_data_with_array,query_data_with_bool,query_data_with_bytes,query_data_with_date,query_data_with_float,query_data_with_int,query_data_with_string,query_data_with_timestamp_parameter,query_data_with_query_options,create_client_with_query_options}
{create_database,insert_data,query_data,read_data,
read_stale_data,add_column,update_data,
query_data_with_new_column,read_write_transaction,
read_only_transaction,add_index,query_data_with_index,
read_data_with_index,add_storing_index,
read_data_with_storing_index,
create_table_with_timestamp,insert_data_with_timestamp,
add_timestamp_column,update_data_with_timestamp,
query_data_with_timestamp,write_struct_data,
query_with_struct,query_with_array_of_struct,
query_struct_field,query_nested_struct_field,
insert_data_with_dml,update_data_with_dml,
delete_data_with_dml,update_data_with_dml_timestamp,
dml_write_read_transaction,update_data_with_dml_struct,
insert_with_dml,query_data_with_parameter,
write_with_dml_transaction,
update_data_with_partitioned_dml,
delete_data_with_partitioned_dml,update_with_batch_dml,
create_table_with_datatypes,insert_datatypes_data,
query_data_with_array,query_data_with_bool,
query_data_with_bytes,query_data_with_date,
query_data_with_float,query_data_with_int,
query_data_with_string,
query_data_with_timestamp_parameter}
...

This application demonstrates how to do basic operations using Cloud
Expand All @@ -101,15 +111,32 @@ To run this sample:

positional arguments:
instance_id Your Cloud Spanner instance ID.
{create_instance,create_database,insert_data,delete_data,query_data,read_data,read_stale_data,add_column,update_data,query_data_with_new_column,read_write_transaction,read_only_transaction,add_index,query_data_with_index,read_data_with_index,add_storing_index,read_data_with_storing_index,create_table_with_timestamp,insert_data_with_timestamp,add_timestamp_column,update_data_with_timestamp,query_data_with_timestamp,write_struct_data,query_with_struct,query_with_array_of_struct,query_struct_field,query_nested_struct_field,insert_data_with_dml,update_data_with_dml,delete_data_with_dml,update_data_with_dml_timestamp,dml_write_read_transaction,update_data_with_dml_struct,insert_with_dml,query_data_with_parameter,write_with_dml_transaction,update_data_with_partitioned_dml,delete_data_with_partitioned_dml,update_with_batch_dml,create_table_with_datatypes,insert_datatypes_data,query_data_with_array,query_data_with_bool,query_data_with_bytes,query_data_with_date,query_data_with_float,query_data_with_int,query_data_with_string,query_data_with_timestamp_parameter,query_data_with_query_options,create_client_with_query_options}
create_instance Creates an instance.
{create_database, insert_data, delete_data, query_data, read_data,
read_stale_data, add_column, update_data, query_data_with_new_column,
read_write_transaction, read_only_transaction, add_index,
query_data_with_index, read_data_with_index, add_storing_index,
read_data_with_storing_index, create_table_with_timestamp,
insert_data_with_timestamp, add_timestamp_column,
update_data_with_timestamp, query_data_with_timestamp,
write_struct_data, query_with_struct, query_with_array_of_struct,
query_struct_field, query_nested_struct_field, insert_data_with_dml,
update_data_with_dml, delete_data_with_dml,
update_data_with_dml_timestamp, dml_write_read_transaction,
update_data_with_dml_struct, insert_with_dml, query_data_with_parameter,
write_with_dml_transaction, update_data_with_partitioned_dml,
delete_data_with_partitioned_dml, update_with_batch_dml,
create_table_with_datatypes, insert_datatypes_data,
query_data_with_array, query_data_with_bool, query_data_with_bytes,
query_data_with_date, query_data_with_float, query_data_with_int,
query_data_with_string, query_data_with_timestamp_parameter}
create_database Creates a database and tables for sample data.
insert_data Inserts sample data into the given database. The
database and table must already exist and can be
created using `create_database`.
delete_data Deletes sample data from the given database. The
database, table, and data must already exist and can
be created using `create_database` and `insert_data`.
database, table, and data must already exist and
can be created using `create_database` and
`insert_data`.
query_data Queries sample data from the database using SQL.
read_data Reads sample data from the database.
read_stale_data Reads sample data from the database. The data is
Expand Down Expand Up @@ -210,53 +237,59 @@ To run this sample:
Deletes sample data from the database using a DML
statement.
update_data_with_dml_timestamp
Updates data with Timestamp from the database using a
DML statement.
Updates data with Timestamp from the database using
a DML statement.
dml_write_read_transaction
First inserts data then reads it from within a
transaction using DML.
update_data_with_dml_struct
Updates data with a DML statement and STRUCT
parameters.
insert_with_dml Inserts data with a DML statement into the database.
insert_with_dml Inserts data with a DML statement into the
database.
query_data_with_parameter
Queries sample data from the database using SQL with a
parameter.
Queries sample data from the database using SQL
with a parameter.
write_with_dml_transaction
Transfers part of a marketing budget from one album to
another.
Transfers part of a marketing budget from one
album to another.
update_data_with_partitioned_dml
Update sample data with a partitioned DML statement.
Update sample data with a partitioned DML
statement.
delete_data_with_partitioned_dml
Delete sample data with a partitioned DML statement.
Delete sample data with a partitioned DML
statement.
update_with_batch_dml
Updates sample data in the database using Batch DML.
Updates sample data in the database using Batch
DML.
create_table_with_datatypes
Creates a table with supported dataypes.
insert_datatypes_data
Inserts data with supported datatypes into a table.
query_data_with_array
Queries sample data using SQL with an ARRAY parameter.
Queries sample data using SQL with an ARRAY
parameter.
query_data_with_bool
Queries sample data using SQL with a BOOL parameter.
Queries sample data using SQL with a BOOL
parameter.
query_data_with_bytes
Queries sample data using SQL with a BYTES parameter.
Queries sample data using SQL with a BYTES
parameter.
query_data_with_date
Queries sample data using SQL with a DATE parameter.
Queries sample data using SQL with a DATE
parameter.
query_data_with_float
Queries sample data using SQL with a FLOAT64
parameter.
query_data_with_int
Queries sample data using SQL with a INT64 parameter.
Queries sample data using SQL with a INT64
parameter.
query_data_with_string
Queries sample data using SQL with a STRING parameter.
Queries sample data using SQL with a STRING
parameter.
query_data_with_timestamp_parameter
Queries sample data using SQL with a TIMESTAMP
parameter.
query_data_with_query_options
Queries sample data using SQL with query options.
create_client_with_query_options
Create a client with query options.

optional arguments:
-h, --help show this help message and exit
Expand All @@ -267,10 +300,6 @@ To run this sample:







The client library
-------------------------------------------------------------------------------

Expand All @@ -286,5 +315,4 @@ to `browse the source`_ and `report issues`_.
https://github.com/GoogleCloudPlatform/google-cloud-python/issues



.. _Google Cloud SDK: https://cloud.google.com/sdk/
.. _Google Cloud SDK: https://cloud.google.com/sdk/
2 changes: 1 addition & 1 deletion samples/samples/backup_sample.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ def restore_database(instance_id, new_database_id, backup_id):
operation = new_database.restore(backup)

# Wait for restore operation to complete.
operation.result(1200)
operation.result(1600)

# Newly created database has restore information.
new_database.reload()
Expand Down
3 changes: 3 additions & 0 deletions samples/samples/backup_sample_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,10 @@
# limitations under the License.
import uuid

from google.api_core.exceptions import DeadlineExceeded
from google.cloud import spanner
import pytest
from test_utils.retry import RetryErrors

import backup_sample

Expand Down Expand Up @@ -68,6 +70,7 @@ def test_create_backup(capsys, database):
assert BACKUP_ID in out


@RetryErrors(exception=DeadlineExceeded, max_tries=2)
def test_restore_database(capsys):
backup_sample.restore_database(INSTANCE_ID, RESTORE_DB_ID, BACKUP_ID)
out, _ = capsys.readouterr()
Expand Down
3 changes: 2 additions & 1 deletion samples/samples/requirements-test.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
pytest==5.4.3
pytest==6.0.1
mock==4.0.2
google-cloud-testutils==0.1.0
93 changes: 92 additions & 1 deletion samples/samples/snippets.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
import argparse
import base64
import datetime
import decimal

from google.cloud import spanner
from google.cloud.spanner_v1 import param_types
Expand Down Expand Up @@ -723,6 +724,64 @@ def query_data_with_timestamp(instance_id, database_id):
# [END spanner_query_data_with_timestamp_column]


# [START spanner_add_numeric_column]
def add_numeric_column(instance_id, database_id):
""" Adds a new NUMERIC column to the Venues table in the example database.
"""
spanner_client = spanner.Client()
instance = spanner_client.instance(instance_id)

database = instance.database(database_id)

operation = database.update_ddl(["ALTER TABLE Venues ADD COLUMN Revenue NUMERIC"])

print("Waiting for operation to complete...")
operation.result(120)

print(
'Altered table "Venues" on database {} on instance {}.'.format(
database_id, instance_id
)
)


# [END spanner_add_numeric_column]


# [START spanner_update_data_with_numeric_column]
def update_data_with_numeric(instance_id, database_id):
"""Updates Venues tables in the database with the NUMERIC
column.

This updates the `Revenue` column which must be created before
running this sample. You can add the column by running the
`add_numeric_column` sample or by running this DDL statement
against your database:

ALTER TABLE Venues ADD COLUMN Revenue NUMERIC
"""
spanner_client = spanner.Client()
instance = spanner_client.instance(instance_id)

database = instance.database(database_id)

with database.batch() as batch:
batch.update(
table="Venues",
columns=("VenueId", "Revenue"),
values=[
(4, decimal.Decimal("35000")),
(19, decimal.Decimal("104500")),
(42, decimal.Decimal("99999999999999999999999999999.99")),
],
)

print("Updated data.")


# [END spanner_update_data_with_numeric_column]


# [START spanner_write_data_for_struct_queries]
def write_struct_data(instance_id, database_id):
"""Inserts sample data that can be used to test STRUCT parameters
Expand Down Expand Up @@ -843,7 +902,7 @@ def query_struct_field(instance_id, database_id):
print(u"SingerId: {}".format(*row))


# [START spanner_field_access_on_struct_parameters]
# [END spanner_field_access_on_struct_parameters]


# [START spanner_field_access_on_nested_struct_parameters]
Expand Down Expand Up @@ -1500,6 +1559,31 @@ def query_data_with_string(instance_id, database_id):
# [END spanner_query_with_string_parameter]


def query_data_with_numeric_parameter(instance_id, database_id):
"""Queries sample data using SQL with a NUMERIC parameter. """
# [START spanner_query_with_numeric_parameter]
# instance_id = "your-spanner-instance"
# database_id = "your-spanner-db-id"
spanner_client = spanner.Client()
instance = spanner_client.instance(instance_id)
database = instance.database(database_id)

example_numeric = decimal.Decimal("100000")
param = {"revenue": example_numeric}
param_type = {"revenue": param_types.NUMERIC}

with database.snapshot() as snapshot:
results = snapshot.execute_sql(
"SELECT VenueId, Revenue FROM Venues " "WHERE Revenue < @revenue",
params=param,
param_types=param_type,
)

for row in results:
print(u"VenueId: {}, Revenue: {}".format(*row))
# [END spanner_query_with_numeric_parameter]


def query_data_with_timestamp_parameter(instance_id, database_id):
"""Queries sample data using SQL with a TIMESTAMP parameter. """
# [START spanner_query_with_timestamp_parameter]
Expand All @@ -1510,6 +1594,13 @@ def query_data_with_timestamp_parameter(instance_id, database_id):
database = instance.database(database_id)

example_timestamp = datetime.datetime.utcnow().isoformat() + "Z"
# [END spanner_query_with_timestamp_parameter]
# Avoid time drift on the local machine.
# https://github.com/GoogleCloudPlatform/python-docs-samples/issues/4197.
example_timestamp = (
datetime.datetime.utcnow() + datetime.timedelta(days=1)
).isoformat() + "Z"
# [START spanner_query_with_timestamp_parameter]
param = {"last_update_time": example_timestamp}
param_type = {"last_update_time": param_types.TIMESTAMP}

Expand Down
Loading