title: load the csv file into Big query auto detect schema using python API
body: <p>I'm trying to load the CSV file with schema under auto detection but I am unable to load the file into Big query. Can any one help me on this.</p>
  
  <p>Please find my code below:</p>
  
  <pre><code>def load_data_from_file(dataset_name, table_name, source_file_name):
  
      bigquery_client = bigquery.Client()
      dataset = bigquery_client.dataset(dataset_name)
      table = dataset.table(table_name)    
      table.reload()
      with open(source_file_name, 'rb') as source_file:        
          job = table.upload_from_file(
              source_file, source_format='text/csv')
      wait_for_job(job)
      print('Loaded {} rows into {}:{}.'.format(
          job.output_rows, dataset_name, table_name))
  def wait_for_job(job):
      while True:
          job.reload()
          if job.state == 'DONE':
              if job.error_result:
                  raise RuntimeError(job.errors)
              return
      time.sleep(1)
  </code></pre>