Having seen the correct format for the setting of variables for sql queries, I'm not finding a similar way to parameterise the table name. For example, I have a simple query as follows
query = """
select price, category, title, sm_title from `product.data_set.table_name` where
product = @product"""
job_config = bigquery.QueryJobConfig(
query_parameters=[
bigquery.ScalarQueryParameter("product", "INT64", product),
])
product_data = client.query(query, job_config=job_config).to_dataframe()
I would like the table_name to be a variable that can be passed in. Is there can option that can be used like is set in the job_config?
table_name = "tablenamegoeshere"line 2:query = f""" select price, category, title, sm_title from `product.data_set.{table_name}` where product = @product"""