ScalarQueryParameter返回类型错误:“列表对象不可调用”

时间:2019-04-14 13:53:42

标签: python google-bigquery

在为bigquery设置参数时,我遇到“无法调用列表对象”的类型错误

title=input()
query = """
   SELECT title 
   FROM `<some BigQuery table>`
   WHERE title LIKE '@title'    #parameter to pass into the query
   ORDER BY title DESC
   LIMIT 100;
"""

params=[
   bigquery.ScalarQueryParameter('title', 'STRING', title) 
]
job_config=bigquery.QueryJobConfig()
job_config.query_parameters=params
query_job=client.query(query,job_config=job_config)

期望运行代码,但出现类型错误:

params=[
    bigquery.ScalarQueryParameter('title', 'STRING', title) 
]

非常感谢。

0 个答案:

没有答案