Uploaded image for project: 'Phoenix'
  1. Phoenix
  2. PHOENIX-6731

Regenerate the protobuf python classes from the Avatica 1.21 .pb file with protoc 3.19

    XMLWordPrintableJSON

Details

    • Hide
      Re-generated the protobuf python files with protoc 3.19 from the Avatica 1.21 descriptors
      Dropped support for Python 3.4, as it cannot run the re-generated classes correctly.
      Show
      Re-generated the protobuf python files with protoc 3.19 from the Avatica 1.21 descriptors Dropped support for Python 3.4, as it cannot run the re-generated classes correctly.

    Description

      While running the PQS test suite with protobuf 3.20+, I got the following error:

      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

      The best course of action probably to re-generate the protobuf code as suggested above.

      Attachments

        Issue Links

          Activity

            People

              stoty Istvan Toth
              stoty Istvan Toth
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: