In the below mentioned query projectname-dataset-tableName is hardcoded in the query
query = """
SELECT city from bigquery-public-data.openaq.global_air_quality WHERE country = 'IN'
"""
How to write the same in more dynamic way? The fulltableid attribute is not returning compatible format.
query1 = """
SELECT city from """ + str(tableGAQ.full_table_id) + """ WHERE country = 'IN'
"""
If you had the following query:
To use a variable to dynamically introduce your table ID, your query will look like this:
)
Notice that your table name has to be written between ` `.