我在街景中上传了几张照片,我想使用 Python 客户端库来更新其元数据。在下面找到我的代码片段:
from google.proto.streetview.publish.v1 import resources_pb2
from google.streetview.publish.v1 import street_view_publish_service_client as client
from google.protobuf import field_mask_pb2
streetview_client = client.StreetViewPublishServiceClient(credentials=credentials)
for photo in streetview_client.list_photos(0, ''):
con = resources_pb2.Connection()
target_id = resources_pb2.PhotoId()
target_id.id = "photo_id"
con.target.id = target_id.id
photo.connections.extend([con])
update_mask = field_mask_pb2.FieldMask()
update_mask.FromJsonString("connections")
response = streetview_client.update_photo(photo, update_mask)
break
我想连接两张照片,所以我将目标 ID 添加到查询照片,并将字段“连接”添加到 update_mask。调用后的结果update_photo
是以下错误消息:
google.gax.errors.RetryError:RetryError(在未归类为瞬态的重试方法中发生异常,由 <_Rendezvous of RPC 以(StatusCode.INVALID_ARGUMENT,不接受空级别名称。)终止。)>)
有什么提示吗?