Query BigQuery from within Google Colab¶
Setup¶
In [ ]:
Copied!
from google.colab import auth
auth.authenticate_user()
print('Authenticated')
from google.colab import auth
auth.authenticate_user()
print('Authenticated')
Authenticated
Query with cell magic¶
In [ ]:
Copied!
%%bigquery --project wx-bq-poc
SELECT COUNT(DISTINCT Visit_number) as visits, shopperID
FROM `wx-bq-poc.prod_adobe_data.V_click_stream_web`
WHERE ShopperID = '2308304'
AND visit_date > '2020-11-17'
AND visit_date <= '2020-11-30'
GROUP BY ShopperID
%%bigquery --project wx-bq-poc
SELECT COUNT(DISTINCT Visit_number) as visits, shopperID
FROM `wx-bq-poc.prod_adobe_data.V_click_stream_web`
WHERE ShopperID = '2308304'
AND visit_date > '2020-11-17'
AND visit_date <= '2020-11-30'
GROUP BY ShopperID
In [ ]:
Copied!