Avoid thriftpy import hook
...since it's a global thing. Make importing more explicit by specifying a path (using pkg_resources) to the .thrift file and loading it explicitly.
This commit is contained in:
@@ -3,12 +3,15 @@ HappyBase, a developer-friendly Python library to interact with Apache
|
||||
HBase.
|
||||
"""
|
||||
|
||||
import pkg_resources as _pkg_resources
|
||||
import thriftpy as _thriftpy
|
||||
_thriftpy.install_import_hook()
|
||||
_thriftpy.load(
|
||||
_pkg_resources.resource_filename('happybase', 'Hbase.thrift'),
|
||||
'Hbase_thrift')
|
||||
|
||||
from ._version import __version__
|
||||
from ._version import __version__ # noqa
|
||||
|
||||
from .connection import DEFAULT_HOST, DEFAULT_PORT, Connection
|
||||
from .table import Table
|
||||
from .batch import Batch
|
||||
from .pool import ConnectionPool, NoConnectionsAvailable
|
||||
from .connection import DEFAULT_HOST, DEFAULT_PORT, Connection # noqa
|
||||
from .table import Table # noqa
|
||||
from .batch import Batch # noqa
|
||||
from .pool import ConnectionPool, NoConnectionsAvailable # noqa
|
||||
|
||||
@@ -8,7 +8,7 @@ from numbers import Integral
|
||||
|
||||
import six
|
||||
|
||||
from .Hbase_thrift import BatchMutation, Mutation
|
||||
from Hbase_thrift import BatchMutation, Mutation
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
@@ -11,7 +11,8 @@ from thriftpy.thrift import TClient
|
||||
from thriftpy.transport import TBufferedTransport, TFramedTransport, TSocket
|
||||
from thriftpy.protocol import TBinaryProtocol, TCompactProtocol
|
||||
|
||||
from .Hbase_thrift import Hbase, ColumnDescriptor
|
||||
from Hbase_thrift import Hbase, ColumnDescriptor
|
||||
|
||||
from .table import Table
|
||||
from .util import ensure_bytes, pep8_to_camel_case
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ from struct import Struct
|
||||
|
||||
from six import iteritems
|
||||
|
||||
from .Hbase_thrift import TScan
|
||||
from Hbase_thrift import TScan
|
||||
|
||||
from .util import thrift_type_to_dict, bytes_increment, OrderedDict
|
||||
from .batch import Batch
|
||||
|
||||
Reference in New Issue
Block a user