Skip to content

Commit 3ad0d22

Browse files
authored
Making bigtable tests run successfully [(#1764)](GoogleCloudPlatform/python-docs-samples#1764)
* Making bigtable tests run successfully * Fixed missing import * Renamed noxfile for new environment * Moving the nox name back
1 parent da1fdc4 commit 3ad0d22

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

samples/hello/main.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ def main(project_id, instance_id, table_id):
5959
print('Writing some greetings to the table.')
6060
greetings = ['Hello World!', 'Hello Cloud Bigtable!', 'Hello Python!']
6161
rows = []
62-
column = 'greeting'
62+
column = 'greeting'.encode()
6363
for i, value in enumerate(greetings):
6464
# Note: This example uses sequential numeric IDs for simplicity,
6565
# but this can result in poor performance in a production
@@ -71,7 +71,7 @@ def main(project_id, instance_id, table_id):
7171
# the best performance, see the documentation:
7272
#
7373
# https://cloud.google.com/bigtable/docs/schema-design
74-
row_key = 'greeting{}'.format(i)
74+
row_key = 'greeting{}'.format(i).encode()
7575
row = table.row(row_key)
7676
row.set_cell(column_family_id,
7777
column,
@@ -83,7 +83,7 @@ def main(project_id, instance_id, table_id):
8383

8484
# [START getting_a_row]
8585
print('Getting a single greeting by row key.')
86-
key = 'greeting0'
86+
key = 'greeting0'.encode()
8787

8888
# Only retrieve the most recent version of the cell.
8989
row_filter = row_filters.CellsColumnLimitFilter(1)

0 commit comments

Comments
 (0)