-
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
New argument create_key
in Python
#7672
Comments
This was a breaking change for us. We had to revert to 3.11.4 to generate python files that weren't causing crashes with this error. |
I'm not familiar with this particular change, but the general rule for Python protobuf is that the protobuf library has to be at least as new as the protoc version used. If you upgrade protoc without upgrading the library, these kind of breakages can occur. |
Having protoc and protobuf at 13.12.4 was causing the following error:
You should also look into the reason why |
False alarm on this one. We discovered that Dataflow workers are using the 3.12.2 version of protobuf. Forcing these workers to use version 3.12.4 resolved this issue. Regardless, there should be documentation for the |
I am facing same error i.e AttributeError: module 'google.protobuf.descriptor' has no attribute '_internal_create_key' |
Now I have a new job, so I may not have the need to struggle in gRPC Python any longer, while the doc on why it is added and how it works is still valuable. And, I don't think submitting a large PR with no comments is a good way to maintain an opensource project. At least, some change-logs could be copied to comment in the PR. |
As acozzette mentioned above "The general rule for Python protobuf is that the protobuf library has to be at least as new as the protoc version used. If you upgrade protoc without upgrading the library, these kind of breakages can occur." This issue is caused because protoc is newer than protobuf runtime. Upgrade the runtime can solve the problem |
I noticed that there comes a new argument
create_key
in class initDescriptorBase
. Thepb2.py
file template also got modified andcreate_key=_descriptor._internal_create_key
added.It brought me a little trouble because I always use the latest version of protoc to generate Python pb2 files while use them in environments with old protobuf lib installed. After I upgrade protobuf lib, all things get OK.
The errors should look like:
I see the changes in #7344. But it didn't explain why they are added. Could anyone give a reference about what they are used for?
The text was updated successfully, but these errors were encountered: