Skip to content

Commit 5ca8bbd

Browse files
HemangChothanikolea2tseaver
authored
docs: clarify 'Table.read_rows' snippet (#50)
Co-authored-by: kolea2 <[email protected]> Co-authored-by: Tres Seaver <[email protected]>
1 parent 89bdd32 commit 5ca8bbd

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

docs/snippets_table.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -202,9 +202,15 @@ def test_bigtable_write_read_drop_truncate():
202202

203203
# Read full table
204204
partial_rows = table.read_rows()
205-
read_rows = [row for row in partial_rows]
205+
206+
# Read row's value
207+
total_rows = []
208+
for row in partial_rows:
209+
cell = row.cells[COLUMN_FAMILY_ID][col_name][0]
210+
print(cell.value.decode("utf-8"))
211+
total_rows.append(cell)
206212
# [END bigtable_read_rows]
207-
assert len(read_rows) == len(rows)
213+
assert len(total_rows) == len(rows)
208214
# [START bigtable_drop_by_prefix]
209215
from google.cloud.bigtable import Client
210216

0 commit comments

Comments
 (0)