connect jupyter notebook to bigquery code example
Example 1: gcp jupyter use python variables in magic bigquery
params = {'date_str_query': '%-2019-02-%'}
%%bigquery df --params $params
select * from `project.dataset.table`
where date_str like @date_str_query
Example 2: gcp jupyter use python variables in magic bigquery
date_str_query = '2019-02-%'
sql = """
select * from `project.dataset.table`
where date_str like {0}
""".format(date_str_query)
df = client.query(sql).to_dataframe()