Skip to main content

All Questions

1 vote
1 answer
141 views

How is protobuf generating this method and is it impossible to get auto-complete for it?

I was looking at a code base (GCP SDK's monitoring API) trying to drill down to get familiar with some methods, but I hit a wall here: https://cloud.google.com/monitoring/custom-metrics/creating-...
red888's user avatar
  • 31.9k
0 votes
1 answer
149 views

Incorrect Protobuf classes are getting generated

I am trying out my first Protobuf sample code from the Protobuf documentation for Python. https://protobuf.dev/getting-started/pythontutorial/ This is my .proto file. syntax = "proto2"; ...
HENSEL WILSON GOVEAS's user avatar
0 votes
0 answers
121 views

Protobuf message from CPP to python

I have define my protobuf message that is serialize in CPP and send to Python program thank to a wrapper. On CPP side, the protobuf message is generate as std::string Here is how I generate in cpp my ...
macchina001's user avatar
2 votes
1 answer
806 views

Decode protobuf without proto files in python

I would like to decode protobuf. Example of the protobuf data: 0a06282c0241057a10011805220d080510bea3f493062a03010c1628f1a6f493063002382b4001481482010f383634333233303532343736343839 I can Decoding ...
henrry's user avatar
  • 623
3 votes
1 answer
3k views

Failing to Import Files Compiled from Protobuf in Python

My directory structure is as follows: test |-test.py |-test.proto |-test_pb2.py |-__init__.py |-comm |-comm.proto |-comm_pb2.py |-__init__.py both __init__.py is empty and test....
charlie's user avatar
  • 309
0 votes
0 answers
1k views

Python Protobuf `MessageToDict` And `MessageToJson` with `include_default_value_fields` Does Add Defaults To `google.protobuf.BoolValue` Fields

I am attempting to use MessageToJSON and MessageToDict with the including_default_value_fields argument to generate a Pandas Dataframe that then gets written to Parquet. I have a deeply nested data ...
AlexLordThorsen's user avatar
0 votes
1 answer
506 views

When constructing an instance of a Python protobuf message, I keep getting positional argument error

I'm using pb_2 and want to consturct instances of a message but keep facing positional argument error. I can construct instances from all other messages but when it comes to the following example, I ...
mahb's user avatar
  • 59
0 votes
0 answers
904 views

Match (lib)protoc version on Mac to Python protobuf==3.19.X

I'm using a Mac/Linux and I'm trying to get python code generated from a .proto file. When I run the protoc --version command in my terminal it returns libprotoc 22.5. When I run a terminal command ...
Jed's user avatar
  • 2,118
0 votes
1 answer
815 views

Compiling Protobuf to Python giving unexpected results

Disclaimer: I am relatively new to Protocol Buffers, and python is not my language of choice. Most of my knowledge of protocol buffers has used them without compiling them, or having an IDE handle it ...
John Doe's user avatar
  • 101
1 vote
1 answer
457 views

How to get type of a protobuf message from a raw protobuf buffer and the .proto files?

Let's say that I have dumped a protobuf message to a file called packet.bin . Let's also say that I have the .proto files which describes many message types of which one is the type of the dumped ...
Some nerd who does not have a 's user avatar
0 votes
1 answer
69 views

how to invalidate toxenv

I have some tox project that processes some protobuf in the install-deps phase and outputs some *pb.py codecs (custom script executed as install_command option in the config). When I'm updating my ...
murison's user avatar
  • 4,005
0 votes
1 answer
314 views

SerializeAsString - server, ParseFromString - client. "Decode error" Exception occurred, but the data looks correct

Our application workflow uses protobuf for cross-language IPC. We have a C++ application publishing data over Linux shared memory to various clients on the same host. Data is published to shared ...
Itzik Ben Zaken's user avatar
0 votes
1 answer
386 views

regex as protobuf message field name?

can we define regular expression in protobuf field name? I send the request as list of dictinary in client.py file "cur_cur_bin" : [{"cur_cur_bin1_bin3_bin1" : 4,"...
PRAJAKTA DHIVAR's user avatar
1 vote
1 answer
371 views

Protoc.py compiles files differently depending on where it is called from

If protoc.py is called from powershell, the compiled file is missing about half of the code as opposed to when protoc.py is called from natively from python. I have a powershell script and a python ...
George Gayton's user avatar
0 votes
1 answer
1k views

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 = str.encode(...
Shoham Roditi's user avatar

15 30 50 per page