0
votes

I want to check the last modified date of BigQuery's tables with Python. In order to do that, I'm using Google Cloud BigQuery client (https://github.com/GoogleCloudPlatform/google-cloud-python/tree/master/bigquery).

When executing the code bellow, the table attribute 'modified' is empty.

google-cloud-bigquery==0.24.0

Code used:

from google.cloud import bigquery

client = bigquery.Client()
dataset = client.dataset(my_dataset)
table = dataset.table(my_table)

print table.modified
1

1 Answers

0
votes

After researching a bit I found this issue https://github.com/GoogleCloudPlatform/google-cloud-python/issues/2756

It describes exactly the same problem I was having but with another table attribute.

It seems like this is a bug in the python client. At a certain point in the GitHub issue, @ahogit gives a temporary solution. You just need to run table.reload() before accessing the table attributes.