【问题标题】:Run queries on Bigquery from Cloud functions从 Cloud 函数对 Bigquery 运行查询
【发布时间】:2021-12-08 18:40:59
【问题描述】:

我正在尝试从云函数运行查询,我读到我可以调用计划查询(按需),我正在运行下面的代码,但我收到“未找到请求的实体”。错误信息。

   def runQuery(transferid):
    #Source Name = 'projects/413410600298/locations/southamerica-east1/transferConfigs/61ae683c-0000-2bc6-bdb5-089e083412ac'   
    print('transferid is')
    print(transferid)
    client = bigquery_datatransfer_v1.DataTransferServiceClient()
    projectid = '413410600298' # Enter your projectID here
    parent = client.project_transfer_config_path(projectid, transferid)
    print('parent is')
    print(parent)
    start_time = bigquery_datatransfer_v1.types.Timestamp(seconds=int(time.time() + 10))
    response = client.start_manual_transfer_runs(parent, requested_run_time=start_time)
    print(response)

【问题讨论】:

  • 您是否尝试过使用 projectID 而不是项目编号?

标签: python google-bigquery google-cloud-functions


【解决方案1】:

我更改了我的变量父级,使其如下所示,并且效果很好!

parent = 'projects/413410600298/locations/southamerica-east1/transferConfigs/' + transferid

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2021-12-30
    • 1970-01-01
    • 2021-10-03
    • 1970-01-01
    • 1970-01-01
    • 2012-11-24
    • 1970-01-01
    相关资源
    最近更新 更多