我已经创建并运行了一个 DataPrep 作业,并且正在尝试在应用引擎上使用来自 python 的模板。我可以使用成功开始工作
gcloud dataflow jobs run
--parameters "inputLocations={\"location1\":\"gs://bucket/folder/*\"},
outputLocations={\"location1\":\"project:dataset.table\"},
customGcsTempLocation=gs://bucket/DataPrep-beta/temp"
--gcs-location gs://bucket/DataPrep-beta/temp/cloud-dataprep-templatename_template
但是试图在应用引擎上使用python;
service = build('dataflow', 'v1b3', credentials=credentials)
input1 = {"location1": "{i1}".format(i1=input)}
output1 = {"location1": "{o1}".format(o1=output)}
print('input location: {}'.format(input1))
GCSPATH="gs://{bucket}/{template}".format(bucket=BUCKET, template=template)
BODY = {
"jobName": "{jobname}".format(jobname=JOBNAME),
"parameters": {
"inputLocations": input1,
"outputLocations": output1,
"customGcsTempLocation": "gs://{}/DataPrep-beta/temp".format(BUCKET)
}
}
print("dataflow request body: {}".format(BODY))
request = service.projects().templates().launch(projectId=PROJECT, gcsPath=GCSPATH, body=BODY)
response = request.execute()
我回来了;
"Invalid JSON payload received. Unknown name "location1" at
'launch_parameters.parameters[1].value': Cannot find field.
Invalid JSON payload received. Unknown name "location1" at
'launch_parameters.parameters[2].value': Cannot find field."
我尝试过的任何东西似乎都不支持将 dict 或 json.dumps() 或 str() 传递给“inputLocations”或“outputLocations”。