def copy_table(dataset_name, table_name, new_table_name, project=None):
 bigquery_client = bigquery.Client(project=project)
 dataset = bigquery_client.dataset(dataset_name)
 table = dataset.table(table_name)
 destination_table = dataset.table(new_table_name)
 job_id = str(uuid.uuid4())
 job = bigquery_client.copy_table(job_id, destination_table, table)
 job.create_disposition = google.cloud.bigquery.job.CreateDisposition.CREATE_IF_NEEDED
 job.begin()
 print 'Waiting for job to finish...'
 wait_for_job(job)
 print 'Table {} copied to {}.'.format(table_name, new_table_name)

def copy_table ( dataset_name , table_name , new_table_name , project = None ) : bigquery_client = bigquery . Client ( project = project ) dataset = bigquery_client . dataset ( dataset_name ) table = dataset . table ( table_name ) destination_table = dataset . table ( new_table_name ) job_id = str ( uuid . uuid4 ( ) ) job = bigquery_client . copy_table ( job_id , destination_table , table ) job . create_disposition = google . cloud . bigquery . job . CreateDisposition . CREATE_IF_NEEDED job . begin ( ) print 'Waiting for job to finish...' wait_for_job ( job ) print 'Table {} copied to {}.' . format ( table_name , new_table_name )
copies a table .