Better Integration of BigQuery and Colab
How you can now easily use Python within Google BigQuery

Google is better integrating its two data analytic tools, BigQuery and Colab — a Notebook for Python. This brings BigQuery SQL and Python closer together, which will especially please Data Scientists and Analysts who work a lot with Python.
To do this, you can now integrate your query results into Colab with a single click [1]. Previously, this was only possible using Google Data Studio and Google Sheets.

The practical thing is that Colab will then open automatically and generate the necessary code for you.
# @title Setup
from google.colab import auth
from google.cloud import bigquery
from google.colab import data_tableproject = ‘triple-silo-2778657’ # Project ID inserted based on the query results selected to explorelocation = ‘US’ # Location inserted based on the query results selected to exploreclient = bigquery.Client(project=project, location=location)data_table.enable_dataframe_formatter()auth.authenticate_user()After that you can use the following command to process the data generated by the BigQuery job:
# Running this code will read results from your previous jobjob = client.get_job(‘bquxjob_2c7453c63_183er0edf8c’) # Job ID inserted based on the query results selected to exploreresults = job.to_dataframe()resultsThis should simplify the process for Data Scientists and Analysts who want to read data from a Data Warehouse or Data Lakehouse that is build on BigQuery and use it for Data Science purposes.
If you work a lot with BigQuery, you might also be interested in the following new features in Google BigQuery — a lot has happened here in the last weeks.
Sources and Further Readings
[1] Google, BigQuery release notes (2022)
