title: Google BigQuery: creating a view via Python google-cloud-bigquery version 0.27.0 vs. 0.28.0
body: <p>All,</p>
  
  <p>I'm having trouble creating a Google BigQuery view in python with the version 0.28 of the bq library that has come out about two weeks ago.  I'm quite certain the problem is on my side, something I'm missing, but I cannot find the issue.</p>
  
  <p>Please be gentle, I don't ask lots of questions online but I'm quite stumped. 
   I'm also not completely incompetent, here are some details:</p>
  
  <ol>
  <li>I have my GOOGLE_APPLICATION_CREDENTIALS set correctly</li>
  <li>All the other commands I've run against bq via python are fine</li>
  <li><p>I've reviewed the 
  <a href="https://cloud.google.com/bigquery/docs/python-client-migration" rel="nofollow noreferrer">https://cloud.google.com/bigquery/docs/python-client-migration</a></p></li>
  <li><p>I think the issue is around the "fix" 
  <a href="https://github.com/GoogleCloudPlatform/google-cloud-python/pull/4038" rel="nofollow noreferrer">https://github.com/GoogleCloudPlatform/google-cloud-python/pull/4038</a>
  BigQuery: replaces table.create() with client.create_table() #4038</p></li>
  <li>I've tried legacy vs. standard sql</li>
  <li>I'm on python 2.7.12 (can't upgrade anytime soon, corporate version thing)</li>
  </ol>
  
  <p>The issue?  The code in the second block below creates a TABLE, with no schema and no records.  It clearly should create a VIEW instead, right?</p>
  
  <p>sudo pip install -Iv google-cloud-bigquery==0.27.0</p>
  
  <pre><code>from google.cloud import bigquery
  
  project=None
  dataset_name = 'my_dataset_id'
  view_name = 'vw_dummy_data20'
  sqlQuery = 'select record_id as id, UPPER(first_name) as first_name, UPPER(last_name) as last_name from [my_project_code:my_dataset_id.dummy_data13]'
  
  bigquery_client = bigquery.Client(project=project)
  dataset = bigquery_client.dataset(dataset_name)
  table = dataset.table(view_name)
  table.view_query = sqlQuery
  
  table.create()
  </code></pre>
  
  <hr>
  
  <p>the above works fine, view created, great!</p>
  
  <p>the below, only a table is created, no rows, no schema, yuck!</p>
  
  <hr>
  
  <p>sudo pip uninstall google-cloud-bigquery</p>
  
  <p>sudo pip install -Iv google-cloud-bigquery==0.28.0</p>
  
  <pre><code>from google.cloud import bigquery
  
  project=None
  dataset_name = 'my_dataset_id'
  view_name = 'vw_dummy_data21'
  sqlQuery = 'select record_id as id, UPPER(first_name) as first_name, UPPER(last_name) as last_name from [my_project_code:my_dataset_id.dummy_data13]'
  
  bigquery_client = bigquery.Client(project=project)
  dataset_ref = bigquery_client.dataset(dataset_name)
  table_ref = dataset_ref.table(view_name)
  table_ref.view_query = sqlQuery
  table_ref.view_use_legacy_sql = True
  
  table = bigquery.Table(table_ref)
  bigquery_client.create_table(table)
  </code></pre>
  
  <p>Other links:</p>
  
  <ul>
  <li><a href="https://stackoverflow.com/questions/33243427/how-can-i-create-a-new-view-in-bigquery-using-the-python-api">How can I create a new view in bigquery using the python API?</a></li>
  <li><a href="https://googlecloudplatform.github.io/google-cloud-python/latest/bigquery/usage.html" rel="nofollow noreferrer">https://googlecloudplatform.github.io/google-cloud-python/latest/bigquery/usage.html</a></li>
  </ul>
  
  <p>Any useful thoughts would be very much appreciated.</p>
  
  <p>Thanks and best regards...Rich</p>