vesoft-inc / nebula-python

Client API of Nebula Graph in Python
191 stars 75 forks source link

ModuleNotFoundError: No module named 'nebula3.fbthrift.py3' in nebula3/fbthrift/util/converter.py #282

Closed dsanmart closed 11 months ago

dsanmart commented 1 year ago

Function execution of to_py_struct() from nebula3/fbthrift/util/converter.py is raising a ModuleNotFoundError. I believe this is happening due to the import of an inexistent module in version 3.4.0.

Steps to reproduce the behavior:

from nebula3.fbthrift.util.converter import to_py_struct

Expected behavior

---------------------------------------------------------------------------
ModuleNotFoundError                       Traceback (most recent call last)
Cell In[53], line 1
----> 1 from nebula3.fbthrift.util.converter import to_py_struct

      1 #! [/usr/bin/python3](https://file+.vscode-resource.vscode-cdn.net/usr/bin/python3)
      2 # Copyright (c) Facebook, Inc. and its affiliates.
      3 #
   (...)
     15 
     16 # pyre-unsafe
     18 from typing import Any, Type, TypeVar
---> 20 from nebula3.fbthrift.py3.types import Enum, Struct
     21 from nebula3.fbthrift.Thrift import TType
     22 from nebula3.fbthrift.util import parse_struct_spec

ModuleNotFoundError: No module named 'nebula3.fbthrift.py3'
wey-gu commented 1 year ago

Interesting finding, @dsanmart

It was introduced via https://github.com/vesoft-inc/nebula-python/pull/98, but by following this, I still cannot generate this file, @Aiee do you have an idea on how this was introduced, and it's a generated file, right?

The thrift we are using in 3.x is v2021.11.29.00, and it seems it comes from https://github.com/facebook/fbthrift/blob/v2021.11.29.00/thrift/lib/py/util/converter.py