title: BigQuery : add new column to existing tables using python BQ API
body: <p>Related question: <a href="https://stackoverflow.com/questions/16702420/bigquery-add-columns-to-table-schema">Bigquery add columns to table schema using BQ command line tools</a></p>
  
  <p>I want to add a new column to existing tables (update the existing table's schema) in BigQuery using BigQuery <a href="https://developers.google.com/resources/api-libraries/documentation/bigquery/v2/python/latest/bigquery_v2.tables.html" rel="nofollow noreferrer">Python API</a>.</p>
  
  <p>However my code seems not working.</p>
  
  <p>Here's my code:</p>
  
  <pre><code>    flow = flow_from_clientsecrets('secret_key_path', scope='my_scope')
      storage = Storage('CREDENTIAL_PATH')
      credentials = storage.get()
      if credentials is None or credentials.invalid:
          credentials = tools.run_flow(flow, storage, tools.argparser.parse_args([]))
      http = httplib2.Http()
      http = credentials.authorize(http)
      bigquery_service = build('bigquery', 'v2', http=http)
      tbObject = bigquery_service.tables()
      query_body = {'schema': {'name':'new_column_name', 'type':'STRING'}}
      tbObject.update(projectId='projectId', datasetId='datasetId', tableId='tableId', body=query_body).execute()
  </code></pre>
  
  <p>it returns <code>Provided schema doesn't match existing table's schema</code> error. 
  Can anyone give me a working Python example?
  Many thanks!</p>