Jupyter on BigQuery
  • 01 Feb 2024
  • 1 Minute to read
  • Dark
    Light
  • PDF

Jupyter on BigQuery

  • Dark
    Light
  • PDF

Article Summary

Panoply on Big Query

  1. Install pandas-gbq in your Python environment.

    Install latest release version via conda
conda install pandas-gbq --channel conda-forge

Install latest release version via pip

pip install pandas-gbq
  1. Import the packages as below:
from pandas.io import gbq
  1. Run the below command in your Python environment:
df=gbq.read_gbq("<Your query>",  project_id="<Your project name>")
  1. Click the highlighted link to generate an authorization code for your Google BigQuery account. You will be asked to choose your BigQuery account.
Note

You will need to authenticate with the @dwh-panoply.io user and not your personal Google user.

jupyter-3.png

jupyter-4.png

  1. Click Allow.

jupyter-5.png

  1. An authorization code will be generated. Copy and paste as shown below:

jupyter-6.png

You have successfully connected Jupyter Notebook to your BigQuery data warehouse.

Note

In case you need to switch between authenticated Google users, you can add the reauth=True parameter to the read_gbq function to force Jupyter to reauthenticate with Google.


Was this article helpful?