[ 
https://issues.apache.org/jira/browse/PHOENIX-6731?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17555064#comment-17555064
 ] 

Istvan Toth commented on PHOENIX-6731:
--------------------------------------

While we could pin the protobuf version, I think that it is better to follow 
the latest and greatest, and re-generate the protobuf python files instead.
The current protocol files were apparently built from avatica 1.10, we should 
update to the latest there as well. (even if we don't use the new fields yet)

The pythonf files generated by the new protoc don't work with Python 3.4, so 
I'm dropping support for that as well, it's long out of support.
Interestingly, 2.7 still works fine with the same generated classes.

> PhoenixDB incompatible with  protobuf 3.20+
> -------------------------------------------
>
>                 Key: PHOENIX-6731
>                 URL: https://issues.apache.org/jira/browse/PHOENIX-6731
>             Project: Phoenix
>          Issue Type: Bug
>          Components: python, queryserver
>    Affects Versions: queryserver-6.0.0
>            Reporter: Istvan Toth
>            Assignee: Istvan Toth
>            Priority: Critical
>
> While running the PQS test suite with protobuf 3.20+, I got the following 
> error:
> {noformat}
> Traceback (most recent call last):
>   File 
> "/Users/stoty/workspaces/apache-phoenix/phoenix-queryserver-parent/phoenix-queryserver-it/./src/it/bin/test_phoenixdb.py",
>  line 21, in <module>
>     import phoenixdb
>   File 
> "/Users/stoty/workspaces/apache-phoenix/phoenix-queryserver-parent/python-phoenixdb/phoenixdb/__init__.py",
>  line 19, in <module>
>     from phoenixdb import errors, types
>   File 
> "/Users/stoty/workspaces/apache-phoenix/phoenix-queryserver-parent/python-phoenixdb/phoenixdb/types.py",
>  line 21, in <module>
>     from phoenixdb.avatica.proto import common_pb2
>   File 
> "/Users/stoty/workspaces/apache-phoenix/phoenix-queryserver-parent/python-phoenixdb/phoenixdb/avatica/__init__.py",
>  line 16, in <module>
>     from .client import AvaticaClient  # noqa: F401
>   File 
> "/Users/stoty/workspaces/apache-phoenix/phoenix-queryserver-parent/python-phoenixdb/phoenixdb/avatica/client.py",
>  line 27, in <module>
>     from phoenixdb.avatica.proto import common_pb2, requests_pb2, 
> responses_pb2
>   File 
> "/Users/stoty/workspaces/apache-phoenix/phoenix-queryserver-parent/python-phoenixdb/phoenixdb/avatica/proto/common_pb2.py",
>  line 47, in <module>
>     _descriptor.EnumValueDescriptor(
>   File 
> "/private/var/folders/vp/3bcljvzx1rl7cjrs_s7r4mp80000gp/T/tmp.SNangr0J/lib/python3.10/site-packages/google/protobuf/descriptor.py",
>  line 755, in __new__
>     _message.Message._CheckCalledFromGeneratedFile()
> TypeError: Descriptors cannot not be created directly.
> If this call came from a _pb2.py file, your generated code is out of date and 
> must be regenerated with protoc >= 3.19.0.
> If you cannot immediately regenerate your protos, some other possible 
> workarounds are:
>  1. Downgrade the protobuf package to 3.20.x or lower.
>  2. Set PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=python (but this will use 
> pure-Python parsing and will be much slower).More information: 
> https://developers.google.com/protocol-buffers/docs/news/2022-05-06#python-updates{noformat}
> The best course of action probably to re-generate the protobuf code as 
> suggested above.



--
This message was sent by Atlassian Jira
(v8.20.7#820007)

Reply via email to