@snippet
def table_update(client, to_delete):
 DATASET_NAME = ('table_update_dataset_%d' % (_millis(),))
 TABLE_NAME = ('table_update_table_%d' % (_millis(),))
 dataset = client.dataset(DATASET_NAME)
 dataset.description = ORIGINAL_DESCRIPTION
 dataset.create()
 to_delete.append(dataset)
 table = dataset.table(TABLE_NAME, SCHEMA)
 table.friendly_name = ORIGINAL_FRIENDLY_NAME
 table.description = ORIGINAL_DESCRIPTION
 table.create()
 to_delete.insert(0, table)
 assert (table.friendly_name == ORIGINAL_FRIENDLY_NAME)
 assert (table.description == ORIGINAL_DESCRIPTION)
 NEW_SCHEMA = table.schema[:]
 NEW_SCHEMA.append(SchemaField('phone', 'string'))
 table.friendly_name = UPDATED_FRIENDLY_NAME
 table.description = UPDATED_DESCRIPTION
 table.schema = NEW_SCHEMA
 table.update()
 assert (table.friendly_name == UPDATED_FRIENDLY_NAME)
 assert (table.description == UPDATED_DESCRIPTION)
 assert (table.schema == NEW_SCHEMA)

@ snippet def table_update ( client , to_delete ) : DATASET_NAME = ( 'table_update_dataset_%d' % ( _millis ( ) , ) ) TABLE_NAME = ( 'table_update_table_%d' % ( _millis ( ) , ) ) dataset = client . dataset ( DATASET_NAME ) dataset . description = ORIGINAL_DESCRIPTION dataset . create ( ) to_delete . append ( dataset ) table = dataset . table ( TABLE_NAME , SCHEMA ) table . friendly_name = ORIGINAL_FRIENDLY_NAME table . description = ORIGINAL_DESCRIPTION table . create ( ) to_delete . insert ( 0 , table ) assert ( table . friendly_name == ORIGINAL_FRIENDLY_NAME ) assert ( table . description == ORIGINAL_DESCRIPTION ) NEW_SCHEMA = table . schema [ : ] NEW_SCHEMA . append ( SchemaField ( 'phone' , 'string' ) ) table . friendly_name = UPDATED_FRIENDLY_NAME table . description = UPDATED_DESCRIPTION table . schema = NEW_SCHEMA table . update ( ) assert ( table . friendly_name == UPDATED_FRIENDLY_NAME ) assert ( table . description == UPDATED_DESCRIPTION ) assert ( table . schema == NEW_SCHEMA )
update a tables metadata .