Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Spanner: Read multiple keys with index #4386

Merged
Changes from all commits
Commits
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
13 changes: 13 additions & 0 deletions spanner/tests/system/test_system.py
Original file line number Diff line number Diff line change
Expand Up @@ -758,6 +758,19 @@ def test_empty_read_with_single_keys_index(self):
rows = list(results_iter)
self.assertEqual(rows, [])

def test_read_with_multiple_keys_index(self):
row_count = 10
columns = self.COLUMNS[1], self.COLUMNS[2]
session, committed = self._set_up_table(row_count)
self.to_delete.append(session)
expected = [[row[1], row[2]] for row in self._row_data(row_count)]
rows = list(session.read(self.TABLE,
columns,
KeySet(keys=expected),
index='name')
)
self.assertEqual(rows, expected)

def test_snapshot_read_w_various_staleness(self):
from datetime import datetime
from google.cloud._helpers import UTC
Expand Down