def create_bigquery_table ( self , database , schema , table_name , callback , sql ) : conn = self . get_thread_connection ( ) client = conn . handle view_ref = self . table_ref ( database , schema , table_name , conn ) view = google . cloud . bigquery . Table ( view_ref ) callback ( view ) with self . exception_handler ( sql ) : client . create_table ( view )
bigquery python create table from query
Create a bigquery table . The caller must supply a callback that takes one argument a google . cloud . bigquery . Table and mutates it .
def create_bigquery_table(self, database, schema, table_name, callback,
                              sql):
        """Create a bigquery table. The caller must supply a callback
        that takes one argument, a `google.cloud.bigquery.Table`, and mutates
        it.
        """
        conn = self.get_thread_connection()
        client = conn.handle

        view_ref = self.table_ref(database, schema, table_name, conn)
        view = google.cloud.bigquery.Table(view_ref)
        callback(view)

        with self.exception_handler(sql):
            client.create_table(view)