Skip to content

Commit 509ac16

Browse files
authored
Spanner: Range read with single key (googleapis#4572)
1 parent 6ac842a commit 509ac16

1 file changed

Lines changed: 10 additions & 4 deletions

File tree

spanner/tests/system/test_system.py

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -940,32 +940,38 @@ def test_read_w_ranges(self):
940940
snapshot = session.snapshot(read_timestamp=committed, multi_use=True)
941941
all_data_rows = list(self._row_data(ROW_COUNT))
942942

943+
single_key = KeyRange(start_closed=[START], end_open=[START + 1])
944+
keyset = KeySet(ranges=(single_key,))
945+
rows = list(snapshot.read(self.TABLE, self.COLUMNS, keyset))
946+
expected = all_data_rows[START : START+1]
947+
self._check_rows_data(rows, expected)
948+
943949
closed_closed = KeyRange(start_closed=[START], end_closed=[END])
944950
keyset = KeySet(ranges=(closed_closed,))
945951
rows = list(snapshot.read(
946952
self.TABLE, self.COLUMNS, keyset))
947-
expected = all_data_rows[START:END+1]
953+
expected = all_data_rows[START : END+1]
948954
self._check_row_data(rows, expected)
949955

950956
closed_open = KeyRange(start_closed=[START], end_open=[END])
951957
keyset = KeySet(ranges=(closed_open,))
952958
rows = list(snapshot.read(
953959
self.TABLE, self.COLUMNS, keyset))
954-
expected = all_data_rows[START:END]
960+
expected = all_data_rows[START : END]
955961
self._check_row_data(rows, expected)
956962

957963
open_open = KeyRange(start_open=[START], end_open=[END])
958964
keyset = KeySet(ranges=(open_open,))
959965
rows = list(snapshot.read(
960966
self.TABLE, self.COLUMNS, keyset))
961-
expected = all_data_rows[START+1:END]
967+
expected = all_data_rows[START+1 : END]
962968
self._check_row_data(rows, expected)
963969

964970
open_closed = KeyRange(start_open=[START], end_closed=[END])
965971
keyset = KeySet(ranges=(open_closed,))
966972
rows = list(snapshot.read(
967973
self.TABLE, self.COLUMNS, keyset))
968-
expected = all_data_rows[START+1:END+1]
974+
expected = all_data_rows[START+1 : END+1]
969975
self._check_row_data(rows, expected)
970976

971977
def test_read_with_range_keys_index_closed_closed(self):

0 commit comments

Comments
 (0)