Skip to content

Instantly share code, notes, and snippets.

@yazgoo
Last active January 17, 2017 11:05
Show Gist options
  • Save yazgoo/fb7bf57a0a72cba3b40d5016d4b76245 to your computer and use it in GitHub Desktop.
Save yazgoo/fb7bf57a0a72cba3b40d5016d4b76245 to your computer and use it in GitHub Desktop.
from google.cloud import bigquery
import sys
bigquery_client = bigquery.Client(
project = "my-project")
query = bigquery_client.run_sync_query("select * from airflow.quotes_" + sys.argv[1])
query.run()
dataset = bigquery_client.dataset("airflow")
table = dataset.table("quotes")
table.reload()
result = table.insert_data(query.rows)
print(query.rows)
print(result)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment