【发布时间】:2021-08-31 12:35:47
【问题描述】:
我试图仅在大查询中的表更新时运行计划查询。为此,我试图让这个 python 代码在云函数中工作,但它给了我错误。非常感谢任何帮助。
我正在运行这个 python 代码:
import time
from google.protobuf.timestamp_pb2 import Timestamp
from google.cloud import bigquery_datatransfer_v1
def runQuery (parent,requested_run_time):
client = bigquery_datatransfer_v1.DataTransferServiceClient()
projectid = '629586xxxx' # Enter your projectID here
transferid = '60cc15f8-xxxx-xxxx-8ba2-xxxxx41bc' # Enter your transferId here
parent = client.transfer_config_path(projectid, transferid)
start_time = Timestamp(seconds=int(time.time() + 10))
response = client.start_manual_transfer_runs(parent, requested_run_time=start_time)
print(response)
我收到此错误
start_manual_transfer_runs() got an unexpected keyword argument 'requested_run_time'
【问题讨论】:
-
嗨@usman rafi,这解决了吗?我想知道您是如何触发云功能的,因为您只想在大查询中的表更新时才运行计划查询。你在使用 pub 子事件吗?
标签: google-cloud-platform google-bigquery google-cloud-functions