-
Notifications
You must be signed in to change notification settings - Fork 15.6k
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
[Python] MergeFrom()
raises TypeError
for the same class
#10040
Comments
What protobuf version are you on? |
With With protobuf 4.21.0 I see a different error
|
is there any news with this issue ? |
We are also seeing this error on Apple M1. It occurs at least as far back as protobuf==3.8.0 on Python 2.x. |
We were able to resolve this by following the ideas in #7408 and changing the path we import with. |
@lhuhn-wish I am getting the same issue for different proto files. I tried the suggested changes but that does not seem to work with protobuf 3.20.1. Which protobuf version are you using? |
I'm going to close this issue as my issue was unrelated to protobuf. I was using proto-plus which appears to have a bug in marshal.py. I've opened googleapis/proto-plus-python#348 to start the process of proposing a fix. |
What version of protobuf and what language are you using?
Version: main
Language: Python
What operating system (Linux, Windows, ...) and version?
Linux
What runtime / compiler are you using (e.g., python version or gcc version)
Python 3.9.12
What did you do?
Steps to reproduce the behavior:
google-cloud-gke-hub
clientWhat did you expect to see
I expected the code to run without error.
What did you see instead?
I saw the following exception
TypeError('Parameter to MergeFrom() must be instance of same class: expected MembershipSpec got google.cloud.gkehub_v1.configmanagement_v1.types.configmanagement.MembershipSpec.')
Make sure you include information that can help us debug (full error message, exception listing, stack trace, logs).
Anything else we should know about your project / environment
I'm working on troubleshooting an issue that a user reported in the python client library here where protobuf is raising
Parameter to MergeFrom() must be instance of same class:
. I'm able to re-create the error using the sample code that the user shared in the issue. I'm having trouble figuring out why these 2 classes are not the same. There is only one class withMembershipSpec
and I'm not sure what's causing this issue. I tried debugging but I haven't been able to locate the discrepancy.https://github.com/googleapis/python-gke-hub/search?q=%22class+MembershipSpec%22.
The text was updated successfully, but these errors were encountered: