Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

proto package is not preserved #91

Open
estrulyov opened this issue Sep 12, 2022 · 3 comments
Open

proto package is not preserved #91

estrulyov opened this issue Sep 12, 2022 · 3 comments

Comments

@estrulyov
Copy link

For this test I pulled the example code from
https://github.com/davidtwomey/pybind11_protobuf_example.git and updated it to use native_proto_caster + latest versions of libs
pybind_proto_example.zip
.

The issue is that the proto created in python has the type <class 'example_pb2.TestMessage'>
but the proto created in C++ has the type <class 'TestMessage'>

The module name is not preserved despite package being specified in example.proto. This breaks isinstance().

We see even more weirdness in our code with nested protos. Sometimes the nested proto includes the full module name (python-style) and sometimes it doesn't (C++ style).

Questions:

  1. Why is it happening?
  2. Is it safe?

To test:
unzip the attached code and run bazel run example

@rwgk
Copy link
Contributor

rwgk commented Sep 12, 2022

@laramiel

@estrulyov
Copy link
Author

ping...

@laramiel
Copy link
Collaborator

laramiel commented Sep 21, 2022

Sorry, I did some experiments with the zip file on my macbook and had a few build related issues that surfaced first.

cue malcolm in the middle meme

Will try to look some more soon-ish.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants