Skip to content

Commit 10da997

Browse files
authored
chore: fix create_bigtable script (#853)
1 parent 1b6a556 commit 10da997

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

scripts/create_bigtable.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
import os
1919
import sys
2020

21+
from google.cloud.bigtable import column_family
2122
import google.cloud.bigtable as bigtable
2223

2324
PROJECT_ID = os.getenv("GOOGLE_CLOUD_PROJECT")
@@ -57,8 +58,11 @@ def create_table(instance):
5758
table_id,
5859
instance,
5960
)
61+
max_versions_rule = column_family.MaxVersionsGCRule(1)
62+
column_family_id = "body_mass_g"
63+
column_families = {column_family_id: max_versions_rule}
6064
if not table.exists():
61-
table.create()
65+
table.create(column_families=column_families)
6266
print(f"Created table {table_id}")
6367

6468

0 commit comments

Comments
 (0)