Repository: incubator-airflow Updated Branches: refs/heads/master 4c0d67f0d -> c97ad4363
[AIRFLOW-2515] Add dependency on thrift_sasl to hive extra This PR adds a dependency on thrift_sasl to hive extra so that HiveServer2Hook.get_conn() works. Closes #3408 from sekikn/AIRFLOW-2515 Project: http://git-wip-us.apache.org/repos/asf/incubator-airflow/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-airflow/commit/c97ad436 Tree: http://git-wip-us.apache.org/repos/asf/incubator-airflow/tree/c97ad436 Diff: http://git-wip-us.apache.org/repos/asf/incubator-airflow/diff/c97ad436 Branch: refs/heads/master Commit: c97ad43634e2b24785283c50829ed9236a9bc69d Parents: 4c0d67f Author: Kengo Seki <[email protected]> Authored: Fri May 25 10:45:23 2018 +0200 Committer: Fokko Driesprong <[email protected]> Committed: Fri May 25 10:45:23 2018 +0200 ---------------------------------------------------------------------- setup.py | 1 + tests/hooks/test_hive_hook.py | 8 +++++++- 2 files changed, 8 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-airflow/blob/c97ad436/setup.py ---------------------------------------------------------------------- diff --git a/setup.py b/setup.py index dcd59af..273d1ce 100644 --- a/setup.py +++ b/setup.py @@ -156,6 +156,7 @@ hive = [ 'hmsclient>=0.1.0', 'pyhive>=0.1.3', 'impyla>=0.13.3', + 'thrift_sasl==0.2.1', 'unicodecsv>=0.14.1' ] jdbc = ['jaydebeapi>=1.1.1'] http://git-wip-us.apache.org/repos/asf/incubator-airflow/blob/c97ad436/tests/hooks/test_hive_hook.py ---------------------------------------------------------------------- diff --git a/tests/hooks/test_hive_hook.py b/tests/hooks/test_hive_hook.py index f1a3b51..b0029ea 100644 --- a/tests/hooks/test_hive_hook.py +++ b/tests/hooks/test_hive_hook.py @@ -30,7 +30,7 @@ from collections import OrderedDict from hmsclient import HMSClient from airflow.exceptions import AirflowException -from airflow.hooks.hive_hooks import HiveCliHook, HiveMetastoreHook +from airflow.hooks.hive_hooks import HiveCliHook, HiveMetastoreHook, HiveServer2Hook from airflow import DAG, configuration from airflow.operators.hive_operator import HiveOperator from airflow.utils import timezone @@ -317,3 +317,9 @@ class TestHiveMetastoreHook(HiveEnvironmentTest): self.assertFalse( self.hook.table_exists(str(random.randint(1, 10000))) ) + + +class TestHiveServer2Hook(unittest.TestCase): + def test_get_conn(self): + hook = HiveServer2Hook() + hook.get_conn()
