from google.cloud import bigquery
import datalab.bigquery as bq
query_job = client.run_sync_query("""
SELECT
CONCAT(
'https://stackoverflow.com/questions/',
CAST(id as STRING)) as url,
view_count
FROM `bigquery-public-data.stackoverflow.posts_questions`
WHERE tags like '%google-bigquery%'
ORDER BY view_count DESC
LIMIT 10""")
results = query_job.result() # Waits for job to complete.
for row in results:
print("{}".format(row.start_time))
I tried to run above code in jupyter notebook but the system gave "AttributeError: 'QueryResults' object has no attribute 'result'"
I cannot find the document to replace the result object.
(the existing document https://cloud.google.com/bigquery/create-simple-app-api is outdated, as run_sync_query is replacing run_query as well) Can you help me?