I'm using the Google Big Query Python Client Library. One of the queries I'm running is a simple count of the number of tables in the dataset and I wanted to know if there is a neater way to assign the query result to a variable than the way I am currently doing it.
from google.cloud import bigquery
client = bigquery.Client()
query = """
SELECT count(*)
AS table_count
FROM project.dataset.INFORMATION_SCHEMA.TABLES
"""
table_count = client.query(query) # returns a query job object
for row in table_count
count = row[0] # assign count value to single variable
Is there a way to do this without needing to use a loop to access the values in the table?