Answers for "gcp jupyter use python variables in magic bigquery"

0

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
Posted by: Guest on December-02-2020
0

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()
Posted by: Guest on December-02-2020

Python Answers by Framework

Browse Popular Code Answers by Language