3131# [START bigtable_async_hw_imports]
3232from google .cloud import bigtable
3333from google .cloud .bigtable .data import row_filters
34- from google .cloud .bigtable .data import RowMutationEntry
35- from google .cloud .bigtable .data import SetCell
36- from google .cloud .bigtable .data import ReadRowsQuery
3734# [END bigtable_async_hw_imports]
3835
36+ # use to ignore warnings
37+ row_filters
38+
3939
4040async def main (project_id , instance_id , table_id ):
4141 # [START bigtable_async_hw_connect]
@@ -85,8 +85,8 @@ async def main(project_id, instance_id, table_id):
8585 #
8686 # https://cloud.google.com/bigtable/docs/schema-design
8787 row_key = "greeting{}" .format (i ).encode ()
88- row_mutation = RowMutationEntry (
89- row_key , SetCell (column_family_id , column , value )
88+ row_mutation = bigtable . data . RowMutationEntry (
89+ row_key , bigtable . data . SetCell (column_family_id , column , value )
9090 )
9191 mutations .append (row_mutation )
9292 await table .bulk_mutate_rows (mutations )
@@ -95,7 +95,7 @@ async def main(project_id, instance_id, table_id):
9595 # [START bigtable_async_hw_create_filter]
9696 # Create a filter to only retrieve the most recent version of the cell
9797 # for each column across entire row.
98- row_filter = row_filters .CellsColumnLimitFilter (1 )
98+ row_filter = bigtable . data . row_filters .CellsColumnLimitFilter (1 )
9999 # [END bigtable_async_hw_create_filter]
100100
101101 # [START bigtable_async_hw_get_with_filter]
@@ -112,7 +112,7 @@ async def main(project_id, instance_id, table_id):
112112 # [START bigtable_async_hw_scan_with_filter]
113113 # [START bigtable_async_hw_scan_all]
114114 print ("Scanning for all greetings:" )
115- query = ReadRowsQuery (row_filter = row_filter )
115+ query = bigtable . data . ReadRowsQuery (row_filter = row_filter )
116116 async for row in await table .read_rows_stream (query ):
117117 cell = row .cells [0 ]
118118 print (cell .value .decode ("utf-8" ))
0 commit comments