ProtoBUF Schema

236 views
Skip to first unread message

Sunitha M

unread,
Sep 14, 2022, 5:32:59 PM9/14/22
to Google Cloud Developers
I am trying to parse twitter messages using protobuf schema but i am stuck in below use case.

'bounding_box': {'type': 'Polygon', 'coordinates': [[[-16.575943, 13.456074], [-16.575943, 13.456074], [-16.575943, 13.456074], [-16.575943, 13.456074]]]}

protobuf Schema:

syntax = "proto3";

package future.dataengineering.twitter.v1beta1;

import "org/eng/twitter/v1beta1/coordinate.proto";
import "plugins/google/gcp/gen_bq_schema/bq_field.proto";

message Place {
string id = 1;
string url = 2;
string place_type = 3;
string name = 4;
string full_name = 5;
string country_code = 6;
string country = 7;
Coordinate bounding_box = 8;
string attributes = 9 [(plugins.google.gcp.gen_bq_schema.bigquery) = {
type_override: "JSON"
}];
}

syntax = "proto3";

package org.eng.twitter.v1beta1;

import "google/protobuf/any.proto";

message Coordinate {
string type = 1;
repeated google.protobuf.Any coordinates = 2;
}
}

Where i am getting error as below:
google.protobuf.json_format.ParseError: Failed to parse tweet field: Failed to parse retweeted_status field: Failed to parse place field: Failed to parse bounding_box field: Failed to parse coordinates field: list indices must be integers or slices, not str.....

Can someone tell me how to parse this.

Osvaldo Lopez Acuña

unread,
Sep 15, 2022, 6:44:32 PM9/15/22
to Google Cloud Developers

In this group, you will find more accurate information and community members that can support you in your issue.

Reply all
Reply to author
Forward
0 new messages