Skip to content

Commit 9582bd9

Browse files
Cleanup bigtable python examples [(#2692)](GoogleCloudPlatform/python-docs-samples#2692)
* Cleanup bigtable python: Use new row types for mutations Update bigtable version in requirements Delete table after tests * Change bigtable cluster variable to bigtable instance for consistency Create and delete quickstart table during test * Fixing step size for metric scaler Create unique tables for quickstart tests * Creating fixtures for quickstart tests Fixing hb quickstart test output * Fix quickstart extra delete table Update happybase to use direct row * Use clearer instance names for tests Create unique instances for metric scaler tests * Linting * remove core dep Co-authored-by: Leah E. Cole <[email protected]>
1 parent 407ddc4 commit 9582bd9

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

samples/hello/main.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ def main(project_id, instance_id, table_id):
7575
#
7676
# https://cloud.google.com/bigtable/docs/schema-design
7777
row_key = 'greeting{}'.format(i).encode()
78-
row = table.row(row_key)
78+
row = table.direct_row(row_key)
7979
row.set_cell(column_family_id,
8080
column,
8181
value,

samples/hello/main_test.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,16 +18,16 @@
1818
from main import main
1919

2020
PROJECT = os.environ['GCLOUD_PROJECT']
21-
BIGTABLE_CLUSTER = os.environ['BIGTABLE_CLUSTER']
22-
TABLE_NAME_FORMAT = 'hello-bigtable-system-tests-{}'
21+
BIGTABLE_INSTANCE = os.environ['BIGTABLE_INSTANCE']
22+
TABLE_NAME_FORMAT = 'hello-world-test-{}'
2323
TABLE_NAME_RANGE = 10000
2424

2525

2626
def test_main(capsys):
2727
table_name = TABLE_NAME_FORMAT.format(
2828
random.randrange(TABLE_NAME_RANGE))
2929

30-
main(PROJECT, BIGTABLE_CLUSTER, table_name)
30+
main(PROJECT, BIGTABLE_INSTANCE, table_name)
3131

3232
out, _ = capsys.readouterr()
3333
assert 'Creating the {} table.'.format(table_name) in out

samples/hello/requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
google-cloud-bigtable==1.2.0
1+
google-cloud-bigtable==1.2.1
22
google-cloud-core==1.1.0

0 commit comments

Comments
 (0)