diff --git a/airflow/providers/apache/impala/provider.yaml b/airflow/providers/apache/impala/provider.yaml index b08374bc82238..4d02db35c9df2 100644 --- a/airflow/providers/apache/impala/provider.yaml +++ b/airflow/providers/apache/impala/provider.yaml @@ -44,3 +44,8 @@ hooks: connection-types: - hook-class-name: airflow.providers.apache.impala.hooks.impala.ImpalaHook connection-type: impala + +additional-extras: + - name: kerberos + dependencies: + - kerberos>=1.3.0 diff --git a/tests/providers/apache/impala/hooks/test_impala.py b/tests/providers/apache/impala/hooks/test_impala.py index a3e1f119360d6..97f1822eef375 100644 --- a/tests/providers/apache/impala/hooks/test_impala.py +++ b/tests/providers/apache/impala/hooks/test_impala.py @@ -54,6 +54,31 @@ def test_get_conn(mock_connect): ) +@patch("airflow.providers.apache.impala.hooks.impala.connect", autospec=True) +def test_get_conn_kerberos(mock_connect): + hook = ImpalaHook() + hook.get_connection = MagicMock( + return_value=Connection( + login="login", + password="password", + host="host", + port=21050, + schema="test", + extra={"auth_mechanism": "GSSAPI", "use_ssl": True}, + ) + ) + hook.get_conn() + mock_connect.assert_called_once_with( + host="host", + port=21050, + user="login", + password="password", + database="test", + use_ssl=True, + auth_mechanism="GSSAPI", + ) + + @patch("airflow.providers.common.sql.hooks.sql.DbApiHook.insert_rows") def test_insert_rows(mock_insert_rows, impala_hook_fixture): table = "table"