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 0e9050c

Browse filesBrowse files
authored
Cleanup spanner tests. (GoogleCloudPlatform#1633)
* Cleanup spanner tests. * Update requirements.
1 parent fe969c3 commit 0e9050c
Copy full SHA for 0e9050c

File tree

Expand file treeCollapse file tree

3 files changed

+126
-227
lines changed
Filter options
Expand file treeCollapse file tree

3 files changed

+126
-227
lines changed

‎spanner/cloud-client/requirements.txt

Copy file name to clipboard
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
google-cloud-spanner==1.3.0
1+
google-cloud-spanner==1.4.0
22
futures==3.2.0; python_version < "3"

‎spanner/cloud-client/snippets.py

Copy file name to clipboardExpand all lines: spanner/cloud-client/snippets.py
+7-7Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -143,11 +143,12 @@ def read_stale_data(instance_id, database_id):
143143
keyset = spanner.KeySet(all_=True)
144144
results = snapshot.read(
145145
table='Albums',
146-
columns=('SingerId', 'AlbumId', 'AlbumTitle',),
146+
columns=('SingerId', 'AlbumId', 'MarketingBudget',),
147147
keyset=keyset)
148148

149149
for row in results:
150-
print(u'SingerId: {}, AlbumId: {}, AlbumTitle: {}'.format(*row))
150+
print(u'SingerId: {}, AlbumId: {}, MarketingBudget: {}'.format(
151+
*row))
151152
# [END spanner_read_stale_data]
152153

153154

@@ -562,9 +563,8 @@ def update_data_with_timestamp(instance_id, database_id):
562563
columns=(
563564
'SingerId', 'AlbumId', 'MarketingBudget', 'LastUpdateTime'),
564565
values=[
565-
(1, 4, 11000, spanner.COMMIT_TIMESTAMP),
566-
(1, 19, 15000, spanner.COMMIT_TIMESTAMP),
567-
(2, 42, 7000, spanner.COMMIT_TIMESTAMP)])
566+
(1, 1, 1000000, spanner.COMMIT_TIMESTAMP),
567+
(2, 2, 750000, spanner.COMMIT_TIMESTAMP)])
568568

569569
print('Updated data.')
570570
# [END spanner_update_data_with_timestamp_column]
@@ -590,11 +590,11 @@ def query_data_with_timestamp(instance_id, database_id):
590590

591591
with database.snapshot() as snapshot:
592592
results = snapshot.execute_sql(
593-
'SELECT SingerId, AlbumId, AlbumTitle FROM Albums '
593+
'SELECT SingerId, AlbumId, MarketingBudget FROM Albums '
594594
'ORDER BY LastUpdateTime DESC')
595595

596596
for row in results:
597-
print(u'SingerId: {}, AlbumId: {}, AlbumTitle: {}'.format(*row))
597+
print(u'SingerId: {}, AlbumId: {}, MarketingBudget: {}'.format(*row))
598598
# [END spanner_query_data_with_timestamp_column]
599599

600600

0 commit comments

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