Questions tagged [protobuf-python]

64 questions
0
votes
0 answers

Produce a path to a field in protobuf in Python

I am working on a function that analyzes data (based on some domain-specific logic) in protobufs. When the function finds an issue, I want to include the path to the offending field, including the indexes for the repeated fields. For example, given…
immutableT
  • 439
  • 4
  • 13
0
votes
1 answer

google.protobuf validation - python

I am trying to implement a validation for protobuf files in Python. I don't want to use an external package. I tried: desc_set = descriptor_pb2.FileDescriptorSet() descriptor_bytes =…
0
votes
0 answers

How to read Kafka message header through Flink Stateful Functions in Python

Is it possible to read Kafka message header which is set in KafkaProducer application, in Flink Stateful function written in Python KafkaProducer looks like this Set
headers = Collections.singleton(new RecordHeader("is_mock_event",…
0
votes
0 answers

Python protobuf how to consume and produce to different topics

I am currently working on a project where I need to connect multiple micro-services with Kafka and to serializer/deserializing messages with protobufer. The services are written with python and use python package "protobuf" (confluent-kafka). I am…
0
votes
1 answer

Where to find protobuf@3.6?

My python gcld3 package broke recently because it is linked against libprotobuf.30.dylib and a recent homebrew update replaced this lib with a newer version. The package protobuf@3.6 has libprotobuf.30.dylib but Homebrew disabled it. Do you know…
Barney Szabolcs
  • 11,846
  • 12
  • 66
  • 91
0
votes
1 answer

I want to use "." in message field name of .proto file

I defined .proto file like: syntax = "proto3"; message networkSliceArray { int32 DRB.UEThpDl.SNSSAI = 1; int32 DRB.UEThpUl.SNSSAI = 2; string networkSliceIdentifier = 3; } I want to parse such type of file. is it possible? or if not…
0
votes
1 answer

PySpark-Streaming protobuf message gives error: AttributeError: 'bytearray' object has no attribute 'WhichOneof'

I am reading protobuf messages from kafka topic using py-spark streaming. While using the msg.WhichOneOf gives error AttributeError: 'bytearray' object has no attribute 'WhichOneof'. The schema protofile is: message InstrumentStatusUpdate { …
aiman
  • 1,049
  • 19
  • 57
0
votes
1 answer

ProtoBuf and TransLink

I've found this GTFS data that I want to use, but IDK how to set up protobuf (preferably in Python) to read the data. Any help would be greatly appreciated. Thanks. https://gtfsrt.api.translink.com.au/
flying_loaf_3
  • 397
  • 2
  • 3
  • 12
0
votes
0 answers

What's the proper way to set a google.protobuf.Int32Value in python?

I'm using Google's Int32Value protobuf in python. I'm wondering what the proper way to set the value is. If we do it during initialization, then we can do my_int_32_value = Int32Value(value=123) If we try to set it after initialization, then is…
information_interchange
  • 2,538
  • 6
  • 31
  • 49
0
votes
1 answer

How can I use protobuf to limit the values passed into it? (python)

I'm creating a python file to read in some json data. Then assigning that data to my protobuf messages. I want to pass in "start_hour": 8 and receive 8 and not EIGHT from my enum. Perhaps I'm missing something completely, or can I do this in a…
0
votes
1 answer

How to do client side load-balancing with custom ThreadPool in gRPC?

I have created a grpc python client with round robin load-balancing policy self.channel = grpc.insecure_channel(self.host,options=[("grpc.lb_policy_name", "round_robin")]) Passed first…
0
votes
1 answer

Get list of proto messages

I'm a newbie to protobufs and I can't seem to get it. I have a proto file like this. message Address{ string Home=1; State state=2; string Name=3; enum State{ STATE_UNKNOWN=0; STATE_ARCHIVED=1; } } And I've added…
hiuoi
  • 3
  • 3
0
votes
1 answer

How to make a basic protobuf program work using Python as on Google's Developer's Website?

I am following the tutorial of protobuf using Python (there isn't one for JavaScript). It doesn't work... and I think it might be outdated as proto2 and as a Python 2 program. How to make it work? So I started with creating a file…
nonopolarity
  • 146,324
  • 131
  • 460
  • 740
0
votes
1 answer

Find unused protobuf messages

We have a large project with many proto-files. Many of those contain messages that are no longer used anywhere, and hence I'd like to delete them. However, due to the size of the project, it's non-trivial to see, which of those messages are still…
0
votes
1 answer

Apache Flink Stateful Function - Serialization problem?

I'm trying to build a project using an Apache Flink Stateful Function in Python, but I can't seem to get it to work. What I've narrowed the issue down to is that it seems when I send the request to my stateful function through my protobuf schema,…