我正在尝试通过 GCP 中的云函数触发计划查询。我尝试遵循几个教程和示例并浏览了文档,但是使用新版本的 APIgoogle-cloud-bigquery-datatransfer==3.1.1
我找不到任何显示正确程序的内容。
您将在我当前的代码下方找到:
from google.cloud import bigquery_datatransfer_v1
def triggerQuery (parent, requested_run_time):
client = bigquery_datatransfer_v1.DataTransferServiceClient()
project_id = '###' # Enter your projectID here
location_id = 'europe' # Enter your locationID here
transfer_id = '###' # Enter your transferId here
transfer_config = {...}
path = f"projects/{project_id}/locations/{location_id}/transferConfigs/{transfer_id}"
parent = client.transfer_config_path(project_id, transfer_id)
response = client.start_manual_transfer_runs(path)
print(response)
我尝试传递给client.start_manual_transfer_runs
或path
但parent
我得到:
TypeError: Invalid constructor input for StartManualTransferRunsRequest: 'projects/###/locations/europe/transferConfigs/###'
我还需要指定 Cloud Function 与有权在 BigQuery 中运行查询的正确服务帐户相关联。
帮助将不胜感激!