@snippet
def table_insert_fetch_data(client, to_delete):
 DATASET_NAME = ('table_insert_fetch_data_dataset_%d' % (_millis(),))
 TABLE_NAME = ('table_insert_fetch_data_table_%d' % (_millis(),))
 dataset = client.dataset(DATASET_NAME)
 dataset.create()
 to_delete.append(dataset)
 table = dataset.table(TABLE_NAME, SCHEMA)
 table.create()
 to_delete.insert(0, table)
 ROWS_TO_INSERT = [(u'Phred Phlyntstone', 32), (u'Wylma Phlyntstone', 29)]
 table.insert_data(ROWS_TO_INSERT)
 _warm_up_inserted_table_data(table)
 found_rows = []
 def do_something(row):
  found_rows.append(row)
 for row in table.fetch_data():
  do_something(row)
 assert (len(found_rows) == len(ROWS_TO_INSERT))
 by_age = operator.itemgetter(1)
 found_rows = reversed(sorted(found_rows, key=by_age))
 for (found, to_insert) in zip(found_rows, ROWS_TO_INSERT):
  assert (found == to_insert)

@ snippet def table_insert_fetch_data ( client , to_delete ) : DATASET_NAME = ( 'table_insert_fetch_data_dataset_%d' % ( _millis ( ) , ) ) TABLE_NAME = ( 'table_insert_fetch_data_table_%d' % ( _millis ( ) , ) ) dataset = client . dataset ( DATASET_NAME ) dataset . create ( ) to_delete . append ( dataset ) table = dataset . table ( TABLE_NAME , SCHEMA ) table . create ( ) to_delete . insert ( 0 , table ) ROWS_TO_INSERT = [ ( u'Phred Phlyntstone' , 32 ) , ( u'Wylma Phlyntstone' , 29 ) ] table . insert_data ( ROWS_TO_INSERT ) _warm_up_inserted_table_data ( table ) found_rows = [ ] def do_something ( row ) : found_rows . append ( row ) for row in table . fetch_data ( ) : do_something ( row ) assert ( len ( found_rows ) == len ( ROWS_TO_INSERT ) ) by_age = operator . itemgetter ( 1 ) found_rows = reversed ( sorted ( found_rows , key = by_age ) ) for ( found , to_insert ) in zip ( found_rows , ROWS_TO_INSERT ) : assert ( found == to_insert )
insert / fetch table data .