diff --git a/omniduct/_version.py b/omniduct/_version.py index a70a2cf..f0c7772 100644 --- a/omniduct/_version.py +++ b/omniduct/_version.py @@ -39,7 +39,6 @@ 'hiveserver2': [ 'pyhive[hive]>=0.4', # Primary client - 'impyla>=0.14.0', # Primary client 'thrift>=0.10.0', # Thrift dependency which seems not to be installed with upstream deps ], diff --git a/omniduct/databases/hiveserver2.py b/omniduct/databases/hiveserver2.py index f6aaba0..18c6447 100644 --- a/omniduct/databases/hiveserver2.py +++ b/omniduct/databases/hiveserver2.py @@ -97,7 +97,10 @@ def _connect(self): self._sqlalchemy_engine = create_engine('hive://{}:{}/{}'.format(self.host, self.port, self.schema)) self._sqlalchemy_metadata = MetaData(self._sqlalchemy_engine) elif self.driver == 'impyla': - import impala.dbapi + try: + import impala.dbapi + except ModuleNotFoundError: + raise ImportError("Please install impyla or specify driver='pyhive'.") self.__hive = impala.dbapi.connect(host=self.host, port=self.port, auth_mechanism=self.auth_mechanism,