Skip to content

Instantly share code, notes, and snippets.

@relud
Created July 30, 2019 18:28
Show Gist options
  • Save relud/275efc475f292ad2e99e5ae13384a5eb to your computer and use it in GitHub Desktop.
Save relud/275efc475f292ad2e99e5ae13384a5eb to your computer and use it in GitHub Desktop.
from google.cloud import bigquery
client = bigquery.Client("moz-fx-data-shar-nonprod-efed")
all_live = sum(
client.get_table(table.full_table_id.replace(":", ".") + "$20190729").num_rows
for dataset in client.list_datasets()
if dataset.dataset_id.endswith("_live")
for table in client.list_tables(dataset.reference)
)
telemetry_live = sum(
client.get_table(table.full_table_id.replace(":", ".") + "$20190729").num_rows
for table in client.list_tables("telemetry_live")
)
print(f"telemetry_live: {telemetry_live:,.0f}")
print(f"*_live: {all_live:,.0f}")
print(f"difference: {all_live-telemetry_live:,.0f}")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment