gcp jupyter use python variables in magic bigquery

Solutions on MaxInterview for gcp jupyter use python variables in magic bigquery by the best coders in the world

showing results for - "gcp jupyter use python variables in magic bigquery"
Paolo
08 Jan 2019
1params = {'date_str_query': '%-2019-02-%'}
2
3%%bigquery df --params $params
4select * from `project.dataset.table`
5where date_str like @date_str_query
6
Fawn
04 Oct 2018
1date_str_query = '2019-02-%'
2sql = """
3select * from `project.dataset.table`
4where date_str like {0}
5""".format(date_str_query)
6df = client.query(sql).to_dataframe()
7